Merge "Fix i18n support for help and error msg in network"

This commit is contained in:
Jenkins 2016-05-16 23:33:23 +00:00 committed by Gerrit Code Review
commit cb068d8c68
7 changed files with 14 additions and 14 deletions

@ -185,7 +185,7 @@ class SetAddressScope(command.Command):
if parsed_args.no_share: if parsed_args.no_share:
attrs['shared'] = False attrs['shared'] = False
if attrs == {}: if attrs == {}:
msg = "Nothing specified to be set." msg = _("Nothing specified to be set.")
raise exceptions.CommandError(msg) raise exceptions.CommandError(msg)
client.update_address_scope(obj, **attrs) client.update_address_scope(obj, **attrs)

@ -219,7 +219,7 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
default_router_grp.add_argument( default_router_grp.add_argument(
'--no-default', '--no-default',
action='store_true', action='store_true',
help=_("Do not use the network as the default external network. " help=_("Do not use the network as the default external network "
"(default)") "(default)")
) )
_add_additional_network_options(parser) _add_additional_network_options(parser)
@ -256,7 +256,7 @@ class DeleteNetwork(common.NetworkAndComputeCommand):
'network', 'network',
metavar="<network>", metavar="<network>",
nargs="+", nargs="+",
help=("Network(s) to delete (name or ID)") help=_("Network(s) to delete (name or ID)")
) )
return parser return parser
@ -282,13 +282,13 @@ class ListNetwork(common.NetworkAndComputeLister):
'--external', '--external',
action='store_true', action='store_true',
default=False, default=False,
help='List external networks', help=_("List external networks")
) )
parser.add_argument( parser.add_argument(
'--long', '--long',
action='store_true', action='store_true',
default=False, default=False,
help='List additional fields in output', help=_("List additional fields in output")
) )
return parser return parser
@ -435,7 +435,7 @@ class SetNetwork(command.Command):
attrs = _get_attrs(self.app.client_manager, parsed_args) attrs = _get_attrs(self.app.client_manager, parsed_args)
if attrs == {}: if attrs == {}:
msg = "Nothing specified to be set" msg = _("Nothing specified to be set")
raise exceptions.CommandError(msg) raise exceptions.CommandError(msg)
client.update_network(obj, **attrs) client.update_network(obj, **attrs)

@ -414,7 +414,7 @@ class SetPort(command.Command):
attrs['fixed_ips'] = [] attrs['fixed_ips'] = []
if attrs == {}: if attrs == {}:
msg = "Nothing specified to be set" msg = _("Nothing specified to be set")
raise exceptions.CommandError(msg) raise exceptions.CommandError(msg)
client.update_port(obj, **attrs) client.update_port(obj, **attrs)

@ -427,7 +427,7 @@ class SetRouter(command.Command):
attrs['routes'] = obj.routes + parsed_args.routes attrs['routes'] = obj.routes + parsed_args.routes
if attrs == {}: if attrs == {}:
msg = "Nothing specified to be set" msg = _("Nothing specified to be set")
raise exceptions.CommandError(msg) raise exceptions.CommandError(msg)
client.update_router(obj, **attrs) client.update_router(obj, **attrs)

@ -519,8 +519,8 @@ class ShowSecurityGroupRule(common.NetworkAndComputeShowOne):
break break
if obj is None: if obj is None:
msg = "Could not find security group rule " \ msg = _("Could not find security group rule with ID ") + \
"with ID %s" % parsed_args.rule parsed_args.rule
raise exceptions.CommandError(msg) raise exceptions.CommandError(msg)
# NOTE(rtheis): Format security group rule # NOTE(rtheis): Format security group rule

@ -141,9 +141,9 @@ def _get_attrs(client_manager, parsed_args, is_create=True):
gateway = parsed_args.gateway.lower() gateway = parsed_args.gateway.lower()
if not is_create and gateway == 'auto': if not is_create and gateway == 'auto':
raise exceptions.CommandError("Auto option is not available" msg = _("Auto option is not available for Subnet Set. "
" for Subnet Set. Valid options are" "Valid options are <ip-address> or none")
" <ip-address> or none") raise exceptions.CommandError(msg)
elif gateway != 'auto': elif gateway != 'auto':
if gateway == 'none': if gateway == 'none':
attrs['gateway_ip'] = None attrs['gateway_ip'] = None

@ -287,7 +287,7 @@ class SetSubnetPool(command.Command):
attrs = _get_attrs(self.app.client_manager, parsed_args) attrs = _get_attrs(self.app.client_manager, parsed_args)
if attrs == {}: if attrs == {}:
msg = "Nothing specified to be set" msg = _("Nothing specified to be set")
raise exceptions.CommandError(msg) raise exceptions.CommandError(msg)
# Existing prefixes must be a subset of the new prefixes. # Existing prefixes must be a subset of the new prefixes.