summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorwanghong <w.wanghong@huawei.com>2014-09-23 14:52:44 +0800
committerwanghong <w.wanghong@huawei.com>2014-09-23 14:52:44 +0800
commit2d1225624c5115491288d53498906226ed53880f (patch)
treebc13c4e14b6385ccef5ca79b3419f344db7215cb /openstackclient
parentffe976ce3edf2e4dc5dd50247a182ca690b4fdd9 (diff)
downloadpython-openstackclient-2d1225624c5115491288d53498906226ed53880f.tar.gz
v3 credential set always needs --user option
Change-Id: Ieca76bb6ee2f328f4e33010623c25eb9c18e6952 Closes-Bug: #1372744
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/identity/v3/credential.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/openstackclient/identity/v3/credential.py b/openstackclient/identity/v3/credential.py
index 43d16c29..f1e17b85 100644
--- a/openstackclient/identity/v3/credential.py
+++ b/openstackclient/identity/v3/credential.py
@@ -151,11 +151,12 @@ class SetCredential(command.Command):
def take_action(self, parsed_args):
self.log.debug('take_action(%s)', parsed_args)
identity_client = self.app.client_manager.identity
- user_id = utils.find_resource(identity_client.users,
- parsed_args.user).id
kwargs = {}
- if user_id:
- kwargs['user'] = user_id
+ if parsed_args.user:
+ user_id = utils.find_resource(identity_client.users,
+ parsed_args.user).id
+ if user_id:
+ kwargs['user'] = user_id
if parsed_args.type:
kwargs['type'] = parsed_args.type
if parsed_args.data: