diff --git a/openstackclient/identity/v3/identity_provider.py b/openstackclient/identity/v3/identity_provider.py index b6c358f2c5..4e086b681b 100644 --- a/openstackclient/identity/v3/identity_provider.py +++ b/openstackclient/identity/v3/identity_provider.py @@ -88,6 +88,8 @@ class CreateIdentityProvider(show.ShowOne): enabled=parsed_args.enabled) idp._info.pop('links', None) + remote_ids = utils.format_list(idp._info.pop('remote_ids', [])) + idp._info['remote_ids'] = remote_ids return zip(*sorted(six.iteritems(idp._info))) @@ -230,9 +232,11 @@ class ShowIdentityProvider(show.ShowOne): @utils.log_method(log) def take_action(self, parsed_args): identity_client = self.app.client_manager.identity - identity_provider = utils.find_resource( + idp = utils.find_resource( identity_client.federation.identity_providers, parsed_args.identity_provider) - identity_provider._info.pop('links', None) - return zip(*sorted(six.iteritems(identity_provider._info))) + idp._info.pop('links', None) + remote_ids = utils.format_list(idp._info.pop('remote_ids', [])) + idp._info['remote_ids'] = remote_ids + return zip(*sorted(six.iteritems(idp._info))) diff --git a/openstackclient/tests/identity/v3/fakes.py b/openstackclient/tests/identity/v3/fakes.py index 61e74f9c86..9fe341ed6a 100644 --- a/openstackclient/tests/identity/v3/fakes.py +++ b/openstackclient/tests/identity/v3/fakes.py @@ -261,6 +261,7 @@ TOKEN_WITH_DOMAIN_ID = { idp_id = 'test_idp' idp_description = 'super exciting IdP description' idp_remote_ids = ['entity1', 'entity2'] +formatted_idp_remote_ids = 'entity1, entity2' IDENTITY_PROVIDER = { 'id': idp_id, diff --git a/openstackclient/tests/identity/v3/test_identity_provider.py b/openstackclient/tests/identity/v3/test_identity_provider.py index bd094ac4ba..db097d5df9 100644 --- a/openstackclient/tests/identity/v3/test_identity_provider.py +++ b/openstackclient/tests/identity/v3/test_identity_provider.py @@ -69,7 +69,7 @@ class TestIdentityProviderCreate(TestIdentityProvider): identity_fakes.idp_description, True, identity_fakes.idp_id, - identity_fakes.idp_remote_ids + identity_fakes.formatted_idp_remote_ids ) self.assertEqual(datalist, data) @@ -103,7 +103,7 @@ class TestIdentityProviderCreate(TestIdentityProvider): identity_fakes.idp_description, True, identity_fakes.idp_id, - identity_fakes.idp_remote_ids + identity_fakes.formatted_idp_remote_ids ) self.assertEqual(datalist, data) @@ -137,7 +137,7 @@ class TestIdentityProviderCreate(TestIdentityProvider): identity_fakes.idp_description, True, identity_fakes.idp_id, - identity_fakes.idp_remote_ids + identity_fakes.formatted_idp_remote_ids ) self.assertEqual(datalist, data) @@ -172,7 +172,7 @@ class TestIdentityProviderCreate(TestIdentityProvider): identity_fakes.idp_description, True, identity_fakes.idp_id, - identity_fakes.idp_remote_ids + identity_fakes.formatted_idp_remote_ids ) self.assertEqual(datalist, data) @@ -211,7 +211,7 @@ class TestIdentityProviderCreate(TestIdentityProvider): identity_fakes.idp_description, True, identity_fakes.idp_id, - identity_fakes.idp_remote_ids + identity_fakes.formatted_idp_remote_ids ) self.assertEqual(datalist, data) @@ -253,7 +253,7 @@ class TestIdentityProviderCreate(TestIdentityProvider): None, False, identity_fakes.idp_id, - identity_fakes.idp_remote_ids + identity_fakes.formatted_idp_remote_ids ) self.assertEqual(datalist, data) @@ -363,7 +363,7 @@ class TestIdentityProviderShow(TestIdentityProvider): identity_fakes.idp_description, True, identity_fakes.idp_id, - identity_fakes.idp_remote_ids + identity_fakes.formatted_idp_remote_ids ) self.assertEqual(datalist, data)