Skip to content

Commit e2ebeb7

Browse files
author
Steve Martinelli
committed
user create v2.0 depends on tenantId in response
User create for v2.0 no longer always contains a tenantId in the response. Add a guard to check for tenantId first before pop'ing it. Change-Id: I428dbc26520bb86efad33768ce04f584217ad168 Closes-Bug: #1352119
1 parent 75e8490 commit e2ebeb7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • openstackclient/identity/v2_0

‎openstackclient/identity/v2_0/user.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ def take_action(self, parsed_args):
9999
# NOTE(dtroyer): The users.create() method wants 'tenant_id' but
100100
# the returned resource has 'tenantId'. Sigh.
101101
# We're using project_id now inside OSC so there.
102-
user._info.update(
103-
{'project_id': user._info.pop('tenantId')}
104-
)
102+
if 'tenantId' in user._info:
103+
user._info.update(
104+
{'project_id': user._info.pop('tenantId')}
105+
)
105106

106107
info = {}
107108
info.update(user._info)

0 commit comments

Comments
 (0)