From 070fa5091d43ee8c1f8f23b83ba36ca9d960f617 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Thu, 13 Nov 2014 16:04:49 -0500 Subject: [PATCH] Remove links from federation related commands in identity v3 We should remove the 'links' portion from the returned object for the following commands: * create/show federation protocol * create/show mapping * create/show identity provider Change-Id: I55654cce1f89de8e532f9acd8092257be33efd85 --- openstackclient/identity/v3/federation_protocol.py | 2 ++ openstackclient/identity/v3/identity_provider.py | 11 +++++------ openstackclient/identity/v3/mapping.py | 10 ++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/openstackclient/identity/v3/federation_protocol.py b/openstackclient/identity/v3/federation_protocol.py index adc4a28b14..693ec94eae 100644 --- a/openstackclient/identity/v3/federation_protocol.py +++ b/openstackclient/identity/v3/federation_protocol.py @@ -61,6 +61,7 @@ class CreateProtocol(show.ShowOne): # user. info['identity_provider'] = parsed_args.identity_provider info['mapping'] = info.pop('mapping_id') + info.pop('links', None) return zip(*sorted(six.iteritems(info))) @@ -179,4 +180,5 @@ class ShowProtocol(show.ShowOne): parsed_args.identity_provider, parsed_args.federation_protocol) info = dict(protocol._info) info['mapping'] = info.pop('mapping_id') + info.pop('links', None) return zip(*sorted(six.iteritems(info))) diff --git a/openstackclient/identity/v3/identity_provider.py b/openstackclient/identity/v3/identity_provider.py index 5e8ee56689..8a1b22d0cf 100644 --- a/openstackclient/identity/v3/identity_provider.py +++ b/openstackclient/identity/v3/identity_provider.py @@ -65,9 +65,9 @@ class CreateIdentityProvider(show.ShowOne): id=parsed_args.identity_provider_id, description=parsed_args.description, enabled=parsed_args.enabled) - info = {} - info.update(idp._info) - return zip(*sorted(six.iteritems(info))) + + idp._info.pop('links', None) + return zip(*sorted(six.iteritems(idp._info))) class DeleteIdentityProvider(command.Command): @@ -176,6 +176,5 @@ class ShowIdentityProvider(show.ShowOne): identity_client.federation.identity_providers, parsed_args.identity_provider) - info = {} - info.update(identity_provider._info) - return zip(*sorted(six.iteritems(info))) + identity_provider._info.pop('links', None) + return zip(*sorted(six.iteritems(identity_provider._info))) diff --git a/openstackclient/identity/v3/mapping.py b/openstackclient/identity/v3/mapping.py index ae5e03bd2d..c530a40439 100644 --- a/openstackclient/identity/v3/mapping.py +++ b/openstackclient/identity/v3/mapping.py @@ -107,9 +107,8 @@ class CreateMapping(show.ShowOne, _RulesReader): mapping_id=parsed_args.mapping, rules=rules) - info = {} - info.update(mapping._info) - return zip(*sorted(six.iteritems(info))) + mapping._info.pop('links', None) + return zip(*sorted(six.iteritems(mapping._info))) class DeleteMapping(command.Command): @@ -204,6 +203,5 @@ class ShowMapping(show.ShowOne): mapping = identity_client.federation.mappings.get(parsed_args.mapping) - info = {} - info.update(mapping._info) - return zip(*sorted(six.iteritems(info))) + mapping._info.pop('links', None) + return zip(*sorted(six.iteritems(mapping._info)))