From c04b49ef07defdecadcf614d9ff4cde4b3dd029b Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Fri, 9 Jan 2015 23:44:25 -0500 Subject: [PATCH] Tweaks to the catalog doc and show command Looks like providing a service id isn't working, so it the help message was reduced to just type and name. Added a bit more to the docs, too. Change-Id: Id7f8b48bdf99773ad55ca7f204f3c779f84633d5 --- doc/source/command-objects/catalog.rst | 6 ++++++ openstackclient/identity/v2_0/catalog.py | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/source/command-objects/catalog.rst b/doc/source/command-objects/catalog.rst index 4e67f3a4e3..89db95d5d4 100644 --- a/doc/source/command-objects/catalog.rst +++ b/doc/source/command-objects/catalog.rst @@ -9,6 +9,7 @@ catalog list List services in the service catalog +.. program:: catalog list .. code:: bash os catalog list @@ -18,7 +19,12 @@ catalog show Display service catalog details +.. program:: catalog show .. code:: bash os catalog show + +.. describe:: + + Service to display (type or name) diff --git a/openstackclient/identity/v2_0/catalog.py b/openstackclient/identity/v2_0/catalog.py index 330dcf3b13..3aeca91827 100644 --- a/openstackclient/identity/v2_0/catalog.py +++ b/openstackclient/identity/v2_0/catalog.py @@ -68,7 +68,7 @@ class ShowCatalog(show.ShowOne): parser.add_argument( 'service', metavar='', - help=_('Service to display (type, name or ID)'), + help=_('Service to display (type or name)'), ) return parser @@ -96,4 +96,9 @@ class ShowCatalog(show.ShowOne): if 'endpoints_links' in data: data.pop('endpoints_links') + if not data: + self.app.log.error('service %s not found\n' % + parsed_args.service) + return ([], []) + return zip(*sorted(six.iteritems(data)))