Skip to content

Commit 2d12256

Browse files
committed
v3 credential set always needs --user option
Change-Id: Ieca76bb6ee2f328f4e33010623c25eb9c18e6952 Closes-Bug: #1372744
1 parent ffe976c commit 2d12256

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎openstackclient/identity/v3/credential.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,12 @@ def get_parser(self, prog_name):
151151
def take_action(self, parsed_args):
152152
self.log.debug('take_action(%s)', parsed_args)
153153
identity_client = self.app.client_manager.identity
154-
user_id = utils.find_resource(identity_client.users,
155-
parsed_args.user).id
156154
kwargs = {}
157-
if user_id:
158-
kwargs['user'] = user_id
155+
if parsed_args.user:
156+
user_id = utils.find_resource(identity_client.users,
157+
parsed_args.user).id
158+
if user_id:
159+
kwargs['user'] = user_id
159160
if parsed_args.type:
160161
kwargs['type'] = parsed_args.type
161162
if parsed_args.data:

0 commit comments

Comments
 (0)