diff --git a/openstackclient/identity/v3/project.py b/openstackclient/identity/v3/project.py index c7806ee178..60efbac4a4 100644 --- a/openstackclient/identity/v3/project.py +++ b/openstackclient/identity/v3/project.py @@ -380,15 +380,8 @@ class ShowProject(command.ShowOne): # identity manager.get() with kwargs directly. project = identity_client.projects.get( project.id, - parents_as_list=parsed_args.parents, - subtree_as_list=parsed_args.children) - - if project._info.get('parents'): - project._info['parents'] = [str(p['project']['id']) - for p in project._info['parents']] - if project._info.get('subtree'): - project._info['subtree'] = [str(p['project']['id']) - for p in project._info['subtree']] + parents_as_ids=parsed_args.parents, + subtree_as_ids=parsed_args.children) project._info.pop('links') return zip(*sorted(six.iteritems(project._info))) diff --git a/openstackclient/tests/unit/identity/v3/test_project.py b/openstackclient/tests/unit/identity/v3/test_project.py index 2ce26c6416..16ac3116f9 100644 --- a/openstackclient/tests/unit/identity/v3/test_project.py +++ b/openstackclient/tests/unit/identity/v3/test_project.py @@ -913,8 +913,8 @@ class TestProjectShow(TestProject): self.projects_mock.get.assert_has_calls([call(self.project.id), call(self.project.id, - parents_as_list=True, - subtree_as_list=False, + parents_as_ids=True, + subtree_as_ids=False, )]) collist = ( @@ -936,7 +936,7 @@ class TestProjectShow(TestProject): self.project.is_domain, self.project.name, self.project.parent_id, - [self.project.parent_id], + [{'project': {'id': self.project.parent_id}}] ) self.assertEqual(data, datalist) @@ -972,8 +972,8 @@ class TestProjectShow(TestProject): columns, data = self.cmd.take_action(parsed_args) self.projects_mock.get.assert_has_calls([call(self.project.id), call(self.project.id, - parents_as_list=False, - subtree_as_list=True, + parents_as_ids=False, + subtree_as_ids=True, )]) collist = ( @@ -995,7 +995,7 @@ class TestProjectShow(TestProject): self.project.is_domain, self.project.name, self.project.parent_id, - ['children-id'], + [{'project': {'id': 'children-id'}}] ) self.assertEqual(data, datalist) @@ -1033,8 +1033,8 @@ class TestProjectShow(TestProject): columns, data = self.cmd.take_action(parsed_args) self.projects_mock.get.assert_has_calls([call(self.project.id), call(self.project.id, - parents_as_list=True, - subtree_as_list=True, + parents_as_ids=True, + subtree_as_ids=True, )]) collist = ( @@ -1057,8 +1057,8 @@ class TestProjectShow(TestProject): self.project.is_domain, self.project.name, self.project.parent_id, - [self.project.parent_id], - ['children-id'], + [{'project': {'id': self.project.parent_id}}], + [{'project': {'id': 'children-id'}}] ) self.assertEqual(data, datalist)