summaryrefslogtreecommitdiff
path: root/openstackclient/volume
diff options
context:
space:
mode:
authorHuanxuan Ao <huanxuan.ao@easystack.cn>2016-06-28 15:54:13 +0800
committerHuanxuan Ao <huanxuan.ao@easystack.cn>2016-06-28 08:12:40 +0000
commit4e46c04f921c81927ded78f17fd28d5a55ebf9e2 (patch)
treedb9c4ab7ecbcd7c066da5c71828e308248651015 /openstackclient/volume
parent9e47688e5eb2d3e4ee8fe0e15d49b34fe7c5512d (diff)
downloadpython-openstackclient-4e46c04f921c81927ded78f17fd28d5a55ebf9e2.tar.gz
Add "--force" option to "volume qos delete" command
Add ``--force`` option to ``volume qos delete`` command in volume v1 and v2 to allow users to delete in-use QoS specification(s). Change-Id: I46036e5f55ced8b8a1be54c521f2a5c242b89160 Closes-Bug: #1596821
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):