From 8a12a39ece3882af56b42898ffee0d537c96edc8 Mon Sep 17 00:00:00 2001 From: sunyajing Date: Tue, 14 Jun 2016 15:44:41 +0800 Subject: Make set/unset command in identity and image pass normally when nothing specified Also update its unit tests. Change-Id: I82b90658b0d4247cdc9a650f14aceda640a32059 Partial-bug: #1588588 --- openstackclient/image/v2/image.py | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'openstackclient/image') diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 62f7bee8..47ba6493 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -803,11 +803,6 @@ class SetImage(command.Command): parsed_args.project_domain, ).id - # Checks if anything that requires getting the image - if not (kwargs or parsed_args.deactivate or parsed_args.activate): - msg = _("No arguments specified") - raise exceptions.CommandError(msg) - image = utils.find_resource( image_client.images, parsed_args.image) @@ -819,10 +814,6 @@ class SetImage(command.Command): image_client.images.reactivate(image.id) activation_status = "activated" - # Check if need to do the actual update - if not kwargs: - return {}, {} - if parsed_args.tags: # Tags should be extended, but duplicates removed kwargs['tags'] = list(set(image.tags).union(set(parsed_args.tags))) @@ -895,10 +886,6 @@ class UnsetImage(command.Command): parsed_args.image, ) - if not (parsed_args.tags or parsed_args.properties): - msg = _("No arguments specified") - raise exceptions.CommandError(msg) - kwargs = {} tagret = 0 propret = 0 -- cgit v1.2.1