summaryrefslogtreecommitdiff
path: root/openstackclient/identity/v3/group.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-06-17 18:43:32 +0000
committerGerrit Code Review <review@openstack.org>2015-06-17 18:43:32 +0000
commit5e095d66b8974e908bd2c1e17bbcd5e41dfee660 (patch)
tree041730a7667373a03c10ed16daa3f7b2ec632026 /openstackclient/identity/v3/group.py
parentd4893efabce193c0444d5d05c1ea922d862bfa67 (diff)
parent2b0013c5c1afe6d2fee5f93cf6928f6f910048c1 (diff)
downloadpython-openstackclient-5e095d66b8974e908bd2c1e17bbcd5e41dfee660.tar.gz
Merge "Refactor option handling for user|group|project domain scoping"
Diffstat (limited to 'openstackclient/identity/v3/group.py')
-rw-r--r--openstackclient/identity/v3/group.py56
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):