summaryrefslogtreecommitdiff
path: root/openstackclient/identity
diff options
context:
space:
mode:
authorRui Chen <chenrui.momo@gmail.com>2017-02-09 17:25:36 +0800
committerRui Chen <chenrui.momo@gmail.com>2017-02-09 19:24:55 +0800
commit4679a4c1933da0b94efb5d3d453d119801289a97 (patch)
tree4a2a41ff6969cb36a8cba3f37d345a10b52e0a64 /openstackclient/identity
parent2966bd0639bba203f1f46216b52a41e7a6596375 (diff)
downloadpython-openstackclient-4679a4c1933da0b94efb5d3d453d119801289a97.tar.gz
Fix --parents and --children options in project show
Options "--parents" and "--children" don't work in "project show" command, fix the issue and add related unit and functional tests. Change-Id: Id9965267a037442f1077f8e1929d0527981f643d Closes-Bug: #1499657
Diffstat (limited to 'openstackclient/identity')
-rw-r--r--openstackclient/identity/v3/project.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/openstackclient/identity/v3/project.py b/openstackclient/identity/v3/project.py
index 12197cdd..43eca2b5 100644
--- a/openstackclient/identity/v3/project.py
+++ b/openstackclient/identity/v3/project.py
@@ -336,13 +336,18 @@ class ShowProject(command.ShowOne):
project = utils.find_resource(
identity_client.projects,
project_str,
- domain_id=domain.id,
- parents_as_list=parsed_args.parents,
- subtree_as_list=parsed_args.children)
+ domain_id=domain.id)
else:
project = utils.find_resource(
identity_client.projects,
- project_str,
+ project_str)
+
+ if parsed_args.parents or parsed_args.children:
+ # NOTE(RuiChen): utils.find_resource() can't pass kwargs,
+ # if id query hit the result at first, so call
+ # 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)