From 2b0013c5c1afe6d2fee5f93cf6928f6f910048c1 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Tue, 9 Jun 2015 17:25:12 -0400 Subject: Refactor option handling for user|group|project domain scoping put the common options in identity.common, this way the help is consistent Change-Id: I5b09cfb56fa0f8d16feb95150f216fccbe9f2b22 --- openstackclient/identity/common.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'openstackclient/identity/common.py') diff --git a/openstackclient/identity/common.py b/openstackclient/identity/common.py index b97a1778..6eca02ba 100644 --- a/openstackclient/identity/common.py +++ b/openstackclient/identity/common.py @@ -109,3 +109,33 @@ def _find_identity_resource(identity_client_manager, name_or_id, pass return resource_type(None, {'id': name_or_id, 'name': name_or_id}) + + +def add_user_domain_option_to_parser(parser): + parser.add_argument( + '--user-domain', + metavar='', + help=('Domain the user belongs to (name or ID). ' + 'This can be used in case collisions between user names ' + 'exist.') + ) + + +def add_group_domain_option_to_parser(parser): + parser.add_argument( + '--group-domain', + metavar='', + help=('Domain the group belongs to (name or ID). ' + 'This can be used in case collisions between group names ' + 'exist.') + ) + + +def add_project_domain_option_to_parser(parser): + parser.add_argument( + '--project-domain', + metavar='', + help=('Domain the project belongs to (name or ID). ' + 'This can be used in case collisions between project names ' + 'exist.') + ) -- cgit v1.2.1