diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2015-01-16 10:54:00 -0600 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2015-01-16 12:59:14 -0600 |
| commit | c2c3f2e0f23f857aa2c8ce17e310996e90ea9b54 (patch) | |
| tree | 7ebf662fe5c0e163496368ff6d2fa09cf7d54ab3 /openstackclient/identity | |
| parent | 9057cedfd4acce5b50af28ef2475952e8530ba29 (diff) | |
| download | python-openstackclient-c2c3f2e0f23f857aa2c8ce17e310996e90ea9b54.tar.gz | |
Update service clist commands for v2 and v3
Changes to the 'service list' commands for Identity v2 and v3:
* Document support for --long
* Add Description to v3 output with --long
* v3 output is now (ID, Name, Type), with (Description, Enabled) added with --long
* Change v2 output to match v3 output, with the absense of Enabled.
* Update doc to match
Closes-Bug: #1411337
Change-Id: I999e3df22f61350cdeba63bbb7d01145c2ffeeaf
Diffstat (limited to 'openstackclient/identity')
| -rw-r--r-- | openstackclient/identity/v2_0/service.py | 14 | ||||
| -rw-r--r-- | openstackclient/identity/v3/service.py | 18 |
2 files changed, 16 insertions, 16 deletions
diff --git a/openstackclient/identity/v2_0/service.py b/openstackclient/identity/v2_0/service.py index 208f7fbc..f8630238 100644 --- a/openstackclient/identity/v2_0/service.py +++ b/openstackclient/identity/v2_0/service.py @@ -125,7 +125,8 @@ class ListService(lister.Lister): '--long', action='store_true', default=False, - help=_('List additional fields in output')) + help=_('List additional fields in output'), + ) return parser def take_action(self, parsed_args): @@ -134,13 +135,12 @@ class ListService(lister.Lister): if parsed_args.long: columns = ('ID', 'Name', 'Type', 'Description') else: - columns = ('ID', 'Name') + columns = ('ID', 'Name', 'Type') data = self.app.client_manager.identity.services.list() - return (columns, - (utils.get_item_properties( - s, columns, - formatters={}, - ) for s in data)) + return ( + columns, + (utils.get_item_properties(s, columns) for s in data), + ) class ShowService(show.ShowOne): diff --git a/openstackclient/identity/v3/service.py b/openstackclient/identity/v3/service.py index 12629253..d63a9537 100644 --- a/openstackclient/identity/v3/service.py +++ b/openstackclient/identity/v3/service.py @@ -15,7 +15,6 @@ """Identity v3 Service action implementations""" -import argparse import logging import six @@ -111,26 +110,27 @@ class ListService(lister.Lister): log = logging.getLogger(__name__ + '.ListService') def get_parser(self, prog_name): - """The --long option is here for compatibility only.""" parser = super(ListService, self).get_parser(prog_name) parser.add_argument( '--long', action='store_true', default=False, - help=argparse.SUPPRESS, + help='List additional fields in output', ) return parser def take_action(self, parsed_args): self.log.debug('take_action(%s)', parsed_args) - columns = ('ID', 'Name', 'Type', 'Enabled') + if parsed_args.long: + columns = ('ID', 'Name', 'Type', 'Description', 'Enabled') + else: + columns = ('ID', 'Name', 'Type') data = self.app.client_manager.identity.services.list() - return (columns, - (utils.get_item_properties( - s, columns, - formatters={}, - ) for s in data)) + return ( + columns, + (utils.get_item_properties(s, columns) for s in data), + ) class SetService(command.Command): |
