summaryrefslogtreecommitdiff
path: root/openstackclient/identity/v3/project.py
diff options
context:
space:
mode:
authorSteve Martinelli <stevemar@ca.ibm.com>2014-10-03 00:07:45 -0400
committerSteve Martinelli <stevemar@ca.ibm.com>2014-10-11 22:35:12 -0400
commita8d4b0eebb563c8aad33300938b1b32347eb0050 (patch)
tree2d69974a6da7a1792044be2b12bb97e88c45969d /openstackclient/identity/v3/project.py
parentf0c57e17c9a4b5bbe2f072a4eacefce3bcf30d45 (diff)
downloadpython-openstackclient-a8d4b0eebb563c8aad33300938b1b32347eb0050.tar.gz
Remove 'links' section from several v3 Identity objects
The links field in the returned objects from the v3 Identity API aren't really useful, so let's remove them. Managed to remove most of them from the core API. I'll likely remove the extension/contribution (oauth/federation) related ones in another patch. Also in this patch the code for setting services and projects was changed. Though not incorrect, it was not needed to copy the entire returned object, we should just need to pass in the fields we want to update. Change-Id: I164ca9ad8b28fa10b291e9115ef40753e387c547
Diffstat (limited to 'openstackclient/identity/v3/project.py')
-rw-r--r--openstackclient/identity/v3/project.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/openstackclient/identity/v3/project.py b/openstackclient/identity/v3/project.py
index 7b3c281c..1cdeb150 100644
--- a/openstackclient/identity/v3/project.py
+++ b/openstackclient/identity/v3/project.py
@@ -94,9 +94,8 @@ class CreateProject(show.ShowOne):
**kwargs
)
- info = {}
- info.update(project._info)
- return zip(*sorted(six.iteritems(info)))
+ project._info.pop('links')
+ return zip(*sorted(six.iteritems(project._info)))
class DeleteProject(command.Command):
@@ -229,7 +228,7 @@ class SetProject(command.Command):
parsed_args.project,
)
- kwargs = project._info
+ kwargs = {}
if parsed_args.name:
kwargs['name'] = parsed_args.name
if parsed_args.domain:
@@ -243,13 +242,6 @@ class SetProject(command.Command):
kwargs['enabled'] = False
if parsed_args.property:
kwargs.update(parsed_args.property)
- if 'id' in kwargs:
- del kwargs['id']
- if 'domain_id' in kwargs:
- # Hack around broken Identity API arg names
- kwargs.update(
- {'domain': kwargs.pop('domain_id')}
- )
identity_client.projects.update(project.id, **kwargs)
return
@@ -287,4 +279,5 @@ class ShowProject(show.ShowOne):
project = utils.find_resource(identity_client.projects,
parsed_args.project)
+ project._info.pop('links')
return zip(*sorted(six.iteritems(project._info)))