summaryrefslogtreecommitdiff
path: root/openstackclient/identity
diff options
context:
space:
mode:
authorsunyajing <yajing.sun@easystack.cn>2016-06-14 15:44:41 +0800
committerSteve Martinelli <s.martinelli@gmail.com>2016-06-17 04:20:28 +0000
commit8a12a39ece3882af56b42898ffee0d537c96edc8 (patch)
tree035553e001193a212fb55d51877585371cd3d16e /openstackclient/identity
parent2c92b60f457a16c315b6286592e9fee534bd4b3d (diff)
downloadpython-openstackclient-8a12a39ece3882af56b42898ffee0d537c96edc8.tar.gz
Make set/unset command in identity and image pass normally when nothing specified
Also update its unit tests. Change-Id: I82b90658b0d4247cdc9a650f14aceda640a32059 Partial-bug: #1588588
Diffstat (limited to 'openstackclient/identity')
-rw-r--r--openstackclient/identity/v2_0/project.py21
-rw-r--r--openstackclient/identity/v2_0/user.py9
2 files changed, 5 insertions, 25 deletions
diff --git a/openstackclient/identity/v2_0/project.py b/openstackclient/identity/v2_0/project.py
index 8be482fe..c4f730e0 100644
--- a/openstackclient/identity/v2_0/project.py
+++ b/openstackclient/identity/v2_0/project.py
@@ -189,13 +189,6 @@ class SetProject(command.Command):
def take_action(self, parsed_args):
identity_client = self.app.client_manager.identity
- if (not parsed_args.name
- and not parsed_args.description
- and not parsed_args.enable
- and not parsed_args.property
- and not parsed_args.disable):
- return
-
project = utils.find_resource(
identity_client.tenants,
parsed_args.project,
@@ -295,7 +288,6 @@ class UnsetProject(command.Command):
metavar='<key>',
action='append',
default=[],
- required=True,
help=_('Unset a project property '
'(repeat option to unset multiple properties)'),
)
@@ -307,11 +299,8 @@ class UnsetProject(command.Command):
identity_client.tenants,
parsed_args.project,
)
- if not parsed_args.property:
- self.app.log.error(_("No changes requested\n"))
- else:
- kwargs = project._info
- for key in parsed_args.property:
- if key in kwargs:
- kwargs[key] = None
- identity_client.tenants.update(project.id, **kwargs)
+ kwargs = project._info
+ for key in parsed_args.property:
+ if key in kwargs:
+ kwargs[key] = None
+ identity_client.tenants.update(project.id, **kwargs)
diff --git a/openstackclient/identity/v2_0/user.py b/openstackclient/identity/v2_0/user.py
index 7777bab8..3ee2a65e 100644
--- a/openstackclient/identity/v2_0/user.py
+++ b/openstackclient/identity/v2_0/user.py
@@ -287,15 +287,6 @@ class SetUser(command.Command):
if parsed_args.password_prompt:
parsed_args.password = utils.get_password(self.app.stdin)
- if (not parsed_args.name
- and not parsed_args.name
- and not parsed_args.password
- and not parsed_args.email
- and not parsed_args.project
- and not parsed_args.enable
- and not parsed_args.disable):
- return
-
user = utils.find_resource(
identity_client.users,
parsed_args.user,