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/v3/group.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/v3/group.py')
| -rw-r--r-- | openstackclient/identity/v3/group.py | 56 |
1 files changed, 7 insertions, 49 deletions
diff --git a/openstackclient/identity/v3/group.py b/openstackclient/identity/v3/group.py index b064eb77..d659f71e 100644 --- a/openstackclient/identity/v3/group.py +++ b/openstackclient/identity/v3/group.py @@ -46,20 +46,8 @@ class AddUserToGroup(command.Command): metavar='<user>', help='User to add to <group> (name or ID)', ) - 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.') - ) - 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.') - ) + common.add_group_domain_option_to_parser(parser) + common.add_user_domain_option_to_parser(parser) return parser def take_action(self, parsed_args): @@ -100,20 +88,8 @@ class CheckUserInGroup(command.Command): metavar='<user>', help='User to check (name or ID)', ) - 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.') - ) - 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.') - ) + common.add_group_domain_option_to_parser(parser) + common.add_user_domain_option_to_parser(parser) return parser def take_action(self, parsed_args): @@ -241,13 +217,7 @@ class ListGroup(lister.Lister): metavar='<user>', help='Filter group list by <user> (name or ID)', ) - 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.') - ) + common.add_user_domain_option_to_parser(parser) parser.add_argument( '--long', action='store_true', @@ -310,20 +280,8 @@ class RemoveUserFromGroup(command.Command): metavar='<user>', help='User to remove from <group> (name or ID)', ) - 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.') - ) - 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.') - ) + common.add_group_domain_option_to_parser(parser) + common.add_user_domain_option_to_parser(parser) return parser def take_action(self, parsed_args): |
