summaryrefslogtreecommitdiff
path: root/openstackclient/identity/v3/user.py
diff options
context:
space:
mode:
authorGuojian Shao <guojian@unitedstack.com>2015-07-16 23:23:45 +0800
committerGuojian Shao <guojian@unitedstack.com>2015-07-16 23:26:11 +0800
commit7b32ec003babec2c6d052146baf2951e465454f5 (patch)
treeea22dc9bc7e7c0ef5f26de3ac7d4e20e9af4ac40 /openstackclient/identity/v3/user.py
parent37c83e6231dcfb2f0f4d28f13f78ac2dc170b768 (diff)
downloadpython-openstackclient-7b32ec003babec2c6d052146baf2951e465454f5.tar.gz
add --project-domain option for user v3
user v3 create/set only support --project option, we need --project-domain to prevent collisions between project names exist. Change-Id: I2d62e5b9bb6df4c5c5a9542514faf2e4365bb18b Closes-Bug: #1475357
Diffstat (limited to 'openstackclient/identity/v3/user.py')
-rw-r--r--openstackclient/identity/v3/user.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/openstackclient/identity/v3/user.py b/openstackclient/identity/v3/user.py
index b72e0d15..459707d2 100644
--- a/openstackclient/identity/v3/user.py
+++ b/openstackclient/identity/v3/user.py
@@ -51,6 +51,7 @@ class CreateUser(show.ShowOne):
metavar='<project>',
help='Default project (name or ID)',
)
+ common.add_project_domain_option_to_parser(parser)
parser.add_argument(
'--password',
metavar='<password>',
@@ -96,10 +97,9 @@ class CreateUser(show.ShowOne):
project_id = None
if parsed_args.project:
- project_id = utils.find_resource(
- identity_client.projects,
- parsed_args.project,
- ).id
+ project_id = common.find_project(identity_client,
+ parsed_args.project,
+ parsed_args.project_domain).id
domain_id = None
if parsed_args.domain:
@@ -301,6 +301,7 @@ class SetUser(command.Command):
metavar='<project>',
help='Set default project (name or ID)',
)
+ common.add_project_domain_option_to_parser(parser)
parser.add_argument(
'--password',
metavar='<password>',
@@ -367,8 +368,9 @@ class SetUser(command.Command):
if parsed_args.description:
kwargs['description'] = parsed_args.description
if parsed_args.project:
- project_id = utils.find_resource(
- identity_client.projects, parsed_args.project).id
+ project_id = common.find_project(identity_client,
+ parsed_args.project,
+ parsed_args.project_domain).id
kwargs['default_project'] = project_id
kwargs['enabled'] = user.enabled
if parsed_args.enable: