From fd876e4cc699d7e6da7c5439a8452c4a8b395139 Mon Sep 17 00:00:00 2001 From: Huanxuan Ao Date: Fri, 23 Sep 2016 13:02:13 +0800 Subject: Fix unset commands to pass normally when nothing specified After I found this problem appear in "volume unset", I checked all the volume command and also found some same problems. This patch fix them all. The main reason of we ignored this problem before is there was not any tests for it. So I add tests for "nothing unset" for them all to test and aviod this problem. Also, I add unit tests for all snapshot commands in volume v1 by the way in this patch. We will need more tests to avoid some ignored problem. Change-Id: I46775f24643d715e168b30785b8b531c0431a55b Partial-bug: #1588588 --- openstackclient/volume/v1/qos_specs.py | 1 - openstackclient/volume/v1/snapshot.py | 2 -- openstackclient/volume/v1/volume_type.py | 2 -- 3 files changed, 5 deletions(-) (limited to 'openstackclient/volume') diff --git a/openstackclient/volume/v1/qos_specs.py b/openstackclient/volume/v1/qos_specs.py index b982c0e6..93c24a21 100644 --- a/openstackclient/volume/v1/qos_specs.py +++ b/openstackclient/volume/v1/qos_specs.py @@ -273,7 +273,6 @@ class UnsetQos(command.Command): '--property', metavar='', action='append', - default=[], help=_('Property to remove from the QoS specification. ' '(repeat option to unset multiple properties)'), ) diff --git a/openstackclient/volume/v1/snapshot.py b/openstackclient/volume/v1/snapshot.py index c4d113a3..bc92c0f5 100644 --- a/openstackclient/volume/v1/snapshot.py +++ b/openstackclient/volume/v1/snapshot.py @@ -283,8 +283,6 @@ class UnsetSnapshot(command.Command): '--property', metavar='', action='append', - default=[], - required=True, help=_('Property to remove from snapshot ' '(repeat option to remove multiple properties)'), ) diff --git a/openstackclient/volume/v1/volume_type.py b/openstackclient/volume/v1/volume_type.py index 625b34dc..61e9f7fc 100644 --- a/openstackclient/volume/v1/volume_type.py +++ b/openstackclient/volume/v1/volume_type.py @@ -188,10 +188,8 @@ class UnsetVolumeType(command.Command): '--property', metavar='', action='append', - default=[], help=_('Remove a property from this volume type ' '(repeat option to remove multiple properties)'), - required=True, ) return parser -- cgit v1.2.1