From 3807354cfecd887094fe55ba7944161d75e38d21 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Wed, 31 Dec 2014 09:56:20 -0600 Subject: [PATCH] Command docs: group Fix up formatting for group command docs and help Change-Id: Icda79842d52da90d5eac2b0fdbc0d576d371378d --- doc/source/command-objects/group.rst | 46 ++++++++++++++-------------- doc/source/commands.rst | 2 +- openstackclient/identity/v3/group.py | 39 ++++++++++++----------- 3 files changed, 45 insertions(+), 42 deletions(-) diff --git a/doc/source/command-objects/group.rst b/doc/source/command-objects/group.rst index 85a0c5cd79..3e7e806f17 100644 --- a/doc/source/command-objects/group.rst +++ b/doc/source/command-objects/group.rst @@ -16,18 +16,18 @@ Add user to group -.. option:: +.. describe:: - Group that user will be added to (name or ID) + Group to contain (name or ID) -.. option:: +.. describe:: - User to add to group (name or ID) + User to add to (name or ID) group contains user ------------------- -Check user in group +Check user membership in group .. program:: group contains user .. code:: bash @@ -36,11 +36,11 @@ Check user in group -.. option:: +.. describe:: - Group to check if user belongs to (name or ID) + Group to check (name or ID) -.. option:: +.. describe:: User to check (name or ID) @@ -60,7 +60,7 @@ Create new group .. option:: --domain - References the domain ID or name which owns the group + Domain to contain new group (name or ID) .. option:: --description @@ -72,7 +72,7 @@ Create new group If the group already exists, return the existing group data and do not fail. -.. option:: +.. describe:: New group name @@ -90,9 +90,9 @@ Delete group .. option:: --domain - Domain where group resides (name or ID) + Domain containing group(s) (name or ID) -.. option:: +.. describe:: Group(s) to delete (name or ID) @@ -115,11 +115,11 @@ List groups .. option:: --user - List group memberships for (name or ID) + Filter group list by (name or ID) .. option:: --long - List additional fields in output (defaults to false) + List additional fields in output group remove user ----------------- @@ -133,13 +133,13 @@ Remove user from group -.. option:: +.. describe:: - Group that user will be removed from (name or ID) + Group containing (name or ID) -.. option:: +.. describe:: - User to remove from group (name or ID) + User to remove from (name or ID) group set --------- @@ -161,20 +161,20 @@ Set group properties .. option:: --domain - New domain that will now own the group (name or ID) + New domain to contain (name or ID) .. option:: --description New group description -.. option:: +.. describe:: Group to modify (name or ID) group show ---------- -Show group details +Display group details .. program:: group show .. code:: bash @@ -185,8 +185,8 @@ Show group details .. option:: --domain - Domain where group resides (name or ID) + Domain containing (name or ID) -.. option:: +.. describe:: Group to display (name or ID) diff --git a/doc/source/commands.rst b/doc/source/commands.rst index eba0a22f71..d137a2707c 100644 --- a/doc/source/commands.rst +++ b/doc/source/commands.rst @@ -83,7 +83,7 @@ referring to both Compute and Volume quotas. * ``endpoint``: (**Identity**) the base URL used to contact a specific service * ``extension``: (**Compute**, **Identity**, **Volume**) OpenStack server API extensions * ``flavor``: (**Compute**) pre-defined server configurations: ram, root disk, etc -* ``group``: Identity - a grouping of users +* ``group``: (**Identity**) a grouping of users * ``host``: Compute - the physical computer running a hypervisor * ``hypervisor``: Compute - the virtual machine manager * ``identity provider``: Identity - a source of users and authentication diff --git a/openstackclient/identity/v3/group.py b/openstackclient/identity/v3/group.py index fbd8dd720b..94e101f31a 100644 --- a/openstackclient/identity/v3/group.py +++ b/openstackclient/identity/v3/group.py @@ -39,12 +39,12 @@ class AddUserToGroup(command.Command): parser.add_argument( 'group', metavar='', - help='Group that user will be added to (name or ID)', + help='Group to contain (name or ID)', ) parser.add_argument( 'user', metavar='', - help='User to add to group (name or ID)', + help='User to add to (name or ID)', ) return parser @@ -68,7 +68,7 @@ class AddUserToGroup(command.Command): class CheckUserInGroup(command.Command): - """Check user in group""" + """Check user membership in group""" log = logging.getLogger(__name__ + '.CheckUserInGroup') @@ -77,7 +77,7 @@ class CheckUserInGroup(command.Command): parser.add_argument( 'group', metavar='', - help='Group to check if user belongs to (name or ID)', + help='Group to check (name or ID)', ) parser.add_argument( 'user', @@ -115,15 +115,18 @@ class CreateGroup(show.ShowOne): parser.add_argument( 'name', metavar='', - help='New group name') - parser.add_argument( - '--description', - metavar='', - help='New group description') + help='New group name', + ) parser.add_argument( '--domain', metavar='', - help='References the domain ID or name which owns the group') + help='Domain to contain new group (name or ID)', + ) + parser.add_argument( + '--description', + metavar='', + help='New group description', + ) parser.add_argument( '--or-show', action='store_true', @@ -173,7 +176,7 @@ class DeleteGroup(command.Command): parser.add_argument( '--domain', metavar='', - help='Domain where group resides (name or ID)', + help='Domain containing group(s) (name or ID)', ) return parser @@ -211,7 +214,7 @@ class ListGroup(lister.Lister): parser.add_argument( '--user', metavar='', - help='List group memberships for (name or ID)', + help='Filter group list by (name or ID)', ) parser.add_argument( '--long', @@ -259,7 +262,7 @@ class ListGroup(lister.Lister): class RemoveUserFromGroup(command.Command): - """Remove user to group""" + """Remove user from group""" log = logging.getLogger(__name__ + '.RemoveUserFromGroup') @@ -268,12 +271,12 @@ class RemoveUserFromGroup(command.Command): parser.add_argument( 'group', metavar='', - help='Group that user will be removed from (name or ID)', + help='Group containing (name or ID)', ) parser.add_argument( 'user', metavar='', - help='User to remove from group (name or ID)', + help='User to remove from (name or ID)', ) return parser @@ -314,7 +317,7 @@ class SetGroup(command.Command): parser.add_argument( '--domain', metavar='', - help='New domain that will now own the group (name or ID)') + help='New domain to contain (name or ID)') parser.add_argument( '--description', metavar='', @@ -341,7 +344,7 @@ class SetGroup(command.Command): class ShowGroup(show.ShowOne): - """Show group details""" + """Display group details""" log = logging.getLogger(__name__ + '.ShowGroup') @@ -355,7 +358,7 @@ class ShowGroup(show.ShowOne): parser.add_argument( '--domain', metavar='', - help='Domain where group resides (name or ID)', + help='Domain containing (name or ID)', ) return parser