diff options
| author | Steve Martinelli <stevemar@ca.ibm.com> | 2015-06-09 17:25:12 -0400 |
|---|---|---|
| committer | Steve Martinelli <stevemar@ca.ibm.com> | 2015-06-17 12:38:40 -0400 |
| commit | 2b0013c5c1afe6d2fee5f93cf6928f6f910048c1 (patch) | |
| tree | 87413a7156db9480e41a5fc158d20152bd2f097e /openstackclient/identity/common.py | |
| parent | c508162d53eca70596ab28333982185cf27d1c38 (diff) | |
| download | python-openstackclient-2b0013c5c1afe6d2fee5f93cf6928f6f910048c1.tar.gz | |
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
Diffstat (limited to 'openstackclient/identity/common.py')
| -rw-r--r-- | openstackclient/identity/common.py | 30 |
1 files changed, 30 insertions, 0 deletions
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='<user-domain>', + 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='<group-domain>', + 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='<project-domain>', + help=('Domain the project belongs to (name or ID). ' + 'This can be used in case collisions between project names ' + 'exist.') + ) |
