diff options
| author | Steve Martinelli <stevemar@ca.ibm.com> | 2014-08-04 00:04:13 -0400 |
|---|---|---|
| committer | Steve Martinelli <stevemar@ca.ibm.com> | 2014-08-04 00:04:13 -0400 |
| commit | e2ebeb7fdcb63576db2b59b9c59f782b2a5e7d75 (patch) | |
| tree | 4c7e9800aa4c88ba25afdfff74cc956160e409ee /openstackclient | |
| parent | 75e8490e54bf442b36534ea9c8b53c203b6a9938 (diff) | |
| download | python-openstackclient-e2ebeb7fdcb63576db2b59b9c59f782b2a5e7d75.tar.gz | |
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
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/identity/v2_0/user.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/openstackclient/identity/v2_0/user.py b/openstackclient/identity/v2_0/user.py index 60af6ddb..b291c882 100644 --- a/openstackclient/identity/v2_0/user.py +++ b/openstackclient/identity/v2_0/user.py @@ -99,9 +99,10 @@ class CreateUser(show.ShowOne): # NOTE(dtroyer): The users.create() method wants 'tenant_id' but # the returned resource has 'tenantId'. Sigh. # We're using project_id now inside OSC so there. - user._info.update( - {'project_id': user._info.pop('tenantId')} - ) + if 'tenantId' in user._info: + user._info.update( + {'project_id': user._info.pop('tenantId')} + ) info = {} info.update(user._info) |
