summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorHuanxuan Ao <huanxuan.ao@easystack.cn>2016-06-06 18:40:38 +0800
committerHuanxuan Ao <huanxuan.ao@easystack.cn>2016-06-06 19:04:36 +0800
commit4bea5d37d9feb4a5925d70ea2a6298793bc924a4 (patch)
tree960ed9343cff711b164f4da1bcd2a4922e330933 /openstackclient
parent93db7f58edf8e1157eacfc22f2b880c4edd91764 (diff)
downloadpython-openstackclient-4bea5d37d9feb4a5925d70ea2a6298793bc924a4.tar.gz
Fix errors for "volume type unset" command
Normally, we can unset multi properties but the "volume type unset" command could not, because the action "append" was missed. So I add it and also fix the unit test and doc in this patch. Change-Id: I20470f2b7bb2a8d7f292cea498826669c3418c77
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/tests/volume/v2/test_type.py6
-rw-r--r--openstackclient/volume/v2/volume_type.py1
2 files changed, 5 insertions, 2 deletions
diff --git a/openstackclient/tests/volume/v2/test_type.py b/openstackclient/tests/volume/v2/test_type.py
index 872b4ae9..10c38612 100644
--- a/openstackclient/tests/volume/v2/test_type.py
+++ b/openstackclient/tests/volume/v2/test_type.py
@@ -397,17 +397,19 @@ class TestTypeUnset(TestType):
def test_type_unset(self):
arglist = [
'--property', 'property',
+ '--property', 'multi_property',
self.volume_type.id,
]
verifylist = [
- ('property', 'property'),
+ ('property', ['property', 'multi_property']),
('volume_type', self.volume_type.id),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
result = self.cmd.take_action(parsed_args)
- self.volume_type.unset_keys.assert_called_once_with('property')
+ self.volume_type.unset_keys.assert_called_once_with(
+ ['property', 'multi_property'])
self.assertIsNone(result)
def test_type_unset_project_access(self):
diff --git a/openstackclient/volume/v2/volume_type.py b/openstackclient/volume/v2/volume_type.py
index 200d9bd5..d881ce1f 100644
--- a/openstackclient/volume/v2/volume_type.py
+++ b/openstackclient/volume/v2/volume_type.py
@@ -263,6 +263,7 @@ class UnsetVolumeType(command.Command):
parser.add_argument(
'--property',
metavar='<key>',
+ action='append',
help=_('Remove a property from this volume type '
'(repeat option to remove multiple properties)'),
)