summaryrefslogtreecommitdiff
path: root/openstackclient/volume
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-06-28 18:26:02 +0000
committerGerrit Code Review <review@openstack.org>2016-06-28 18:26:03 +0000
commit9422f8bdeae54c27e7ecbe6e3f60a126a3d83dfc (patch)
tree9a1779bee6418906b2993f225994df7c461d2caf /openstackclient/volume
parentbc4acba15ece5b7ff9314f5958db2f9b8e0dc330 (diff)
parent4e46c04f921c81927ded78f17fd28d5a55ebf9e2 (diff)
downloadpython-openstackclient-9422f8bdeae54c27e7ecbe6e3f60a126a3d83dfc.tar.gz
Merge "Add "--force" option to "volume qos delete" command"
Diffstat (limited to 'openstackclient/volume')
-rw-r--r--openstackclient/volume/v1/qos_specs.py8
-rw-r--r--openstackclient/volume/v2/qos_specs.py8
2 files changed, 14 insertions, 2 deletions
diff --git a/openstackclient/volume/v1/qos_specs.py b/openstackclient/volume/v1/qos_specs.py
index 56a96256..c5850871 100644
--- a/openstackclient/volume/v1/qos_specs.py
+++ b/openstackclient/volume/v1/qos_specs.py
@@ -103,13 +103,19 @@ class DeleteQos(command.Command):
nargs="+",
help=_('QoS specification(s) to delete (name or ID)'),
)
+ parser.add_argument(
+ '--force',
+ action='store_true',
+ default=False,
+ help=_("Allow to delete in-use QoS specification(s)")
+ )
return parser
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
for qos in parsed_args.qos_specs:
qos_spec = utils.find_resource(volume_client.qos_specs, qos)
- volume_client.qos_specs.delete(qos_spec.id)
+ volume_client.qos_specs.delete(qos_spec.id, parsed_args.force)
class DisassociateQos(command.Command):
diff --git a/openstackclient/volume/v2/qos_specs.py b/openstackclient/volume/v2/qos_specs.py
index 7ec272b3..5ed1225b 100644
--- a/openstackclient/volume/v2/qos_specs.py
+++ b/openstackclient/volume/v2/qos_specs.py
@@ -103,13 +103,19 @@ class DeleteQos(command.Command):
nargs="+",
help=_('QoS specification(s) to delete (name or ID)'),
)
+ parser.add_argument(
+ '--force',
+ action='store_true',
+ default=False,
+ help=_("Allow to delete in-use QoS specification(s)")
+ )
return parser
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
for qos in parsed_args.qos_specs:
qos_spec = utils.find_resource(volume_client.qos_specs, qos)
- volume_client.qos_specs.delete(qos_spec.id)
+ volume_client.qos_specs.delete(qos_spec.id, parsed_args.force)
class DisassociateQos(command.Command):