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
This commit is contained in:
Steve Martinelli 2014-11-13 16:04:49 -05:00
parent b8d8e35a27
commit 070fa5091d
3 changed files with 11 additions and 12 deletions

View File

@ -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)))

View File

@ -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)))

View File

@ -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)))