summaryrefslogtreecommitdiff
path: root/openstackclient/volume
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/volume')
-rw-r--r--openstackclient/volume/v2/volume.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/openstackclient/volume/v2/volume.py b/openstackclient/volume/v2/volume.py
index 9b58d73d..5d9d2d9e 100644
--- a/openstackclient/volume/v2/volume.py
+++ b/openstackclient/volume/v2/volume.py
@@ -433,12 +433,17 @@ class UnsetVolume(command.Command):
parser.add_argument(
'--property',
metavar='<key>',
- required=True,
action='append',
- default=[],
help='Property to remove from volume '
'(repeat option to remove multiple properties)',
)
+ parser.add_argument(
+ '--image-property',
+ metavar='<key>',
+ action='append',
+ help='To remove image properties from volume '
+ '(repeat option to remove multiple image properties)',
+ )
return parser
def take_action(self, parsed_args):
@@ -446,5 +451,12 @@ class UnsetVolume(command.Command):
volume = utils.find_resource(
volume_client.volumes, parsed_args.volume)
- volume_client.volumes.delete_metadata(
- volume.id, parsed_args.property)
+ if parsed_args.property:
+ volume_client.volumes.delete_metadata(
+ volume.id, parsed_args.property)
+ if parsed_args.image_property:
+ volume_client.volumes.delete_image_metadata(
+ volume.id, parsed_args.image_property)
+
+ if (not parsed_args.image_property and not parsed_args.property):
+ self.app.log.error("No changes requested\n")