diff --git a/tackerclient/tacker/v1_0/__init__.py b/tackerclient/tacker/v1_0/__init__.py index a5211e86..edfab994 100644 --- a/tackerclient/tacker/v1_0/__init__.py +++ b/tackerclient/tacker/v1_0/__init__.py @@ -649,6 +649,10 @@ class ShowCommand(TackerCommand, show.ShowOne): log = None allow_names = True + def get_id(self): + if self.resource: + return self.resource.upper() + def get_parser(self, prog_name): parser = super(ShowCommand, self).get_parser(prog_name) add_show_list_common_argument(parser) @@ -657,7 +661,7 @@ class ShowCommand(TackerCommand, show.ShowOne): else: help_str = _('ID of %s to look up') parser.add_argument( - 'id', metavar=self.resource.upper(), + 'id', metavar=self.get_id(), help=help_str % self.resource) return parser diff --git a/tackerclient/tacker/v1_0/extension.py b/tackerclient/tacker/v1_0/extension.py index 67ba64da..29612c2d 100644 --- a/tackerclient/tacker/v1_0/extension.py +++ b/tackerclient/tacker/v1_0/extension.py @@ -14,7 +14,6 @@ # under the License. # -from tackerclient.common._i18n import _ from tackerclient.tacker import v1_0 as cmd_base @@ -31,10 +30,5 @@ class ShowExt(cmd_base.ShowCommand): resource = "extension" allow_names = False - def get_parser(self, prog_name): - parser = super(ShowExt, self).get_parser(prog_name) - cmd_base.add_show_list_common_argument(parser) - parser.add_argument( - 'id', metavar='EXT-ALIAS', - help=_('The extension alias')) - return parser + def get_id(self): + return 'EXT-ALIAS'