Merge "Fix i18n support for help and error msg in network"
This commit is contained in:
commit
cb068d8c68
openstackclient/network/v2
@ -185,7 +185,7 @@ class SetAddressScope(command.Command):
|
||||
if parsed_args.no_share:
|
||||
attrs['shared'] = False
|
||||
if attrs == {}:
|
||||
msg = "Nothing specified to be set."
|
||||
msg = _("Nothing specified to be set.")
|
||||
raise exceptions.CommandError(msg)
|
||||
client.update_address_scope(obj, **attrs)
|
||||
|
||||
|
@ -219,7 +219,7 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
|
||||
default_router_grp.add_argument(
|
||||
'--no-default',
|
||||
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)")
|
||||
)
|
||||
_add_additional_network_options(parser)
|
||||
@ -256,7 +256,7 @@ class DeleteNetwork(common.NetworkAndComputeCommand):
|
||||
'network',
|
||||
metavar="<network>",
|
||||
nargs="+",
|
||||
help=("Network(s) to delete (name or ID)")
|
||||
help=_("Network(s) to delete (name or ID)")
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -282,13 +282,13 @@ class ListNetwork(common.NetworkAndComputeLister):
|
||||
'--external',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='List external networks',
|
||||
help=_("List external networks")
|
||||
)
|
||||
parser.add_argument(
|
||||
'--long',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='List additional fields in output',
|
||||
help=_("List additional fields in output")
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -435,7 +435,7 @@ class SetNetwork(command.Command):
|
||||
|
||||
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
||||
if attrs == {}:
|
||||
msg = "Nothing specified to be set"
|
||||
msg = _("Nothing specified to be set")
|
||||
raise exceptions.CommandError(msg)
|
||||
|
||||
client.update_network(obj, **attrs)
|
||||
|
@ -414,7 +414,7 @@ class SetPort(command.Command):
|
||||
attrs['fixed_ips'] = []
|
||||
|
||||
if attrs == {}:
|
||||
msg = "Nothing specified to be set"
|
||||
msg = _("Nothing specified to be set")
|
||||
raise exceptions.CommandError(msg)
|
||||
client.update_port(obj, **attrs)
|
||||
|
||||
|
@ -427,7 +427,7 @@ class SetRouter(command.Command):
|
||||
attrs['routes'] = obj.routes + parsed_args.routes
|
||||
|
||||
if attrs == {}:
|
||||
msg = "Nothing specified to be set"
|
||||
msg = _("Nothing specified to be set")
|
||||
raise exceptions.CommandError(msg)
|
||||
|
||||
client.update_router(obj, **attrs)
|
||||
|
@ -519,8 +519,8 @@ class ShowSecurityGroupRule(common.NetworkAndComputeShowOne):
|
||||
break
|
||||
|
||||
if obj is None:
|
||||
msg = "Could not find security group rule " \
|
||||
"with ID %s" % parsed_args.rule
|
||||
msg = _("Could not find security group rule with ID ") + \
|
||||
parsed_args.rule
|
||||
raise exceptions.CommandError(msg)
|
||||
|
||||
# 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()
|
||||
|
||||
if not is_create and gateway == 'auto':
|
||||
raise exceptions.CommandError("Auto option is not available"
|
||||
" for Subnet Set. Valid options are"
|
||||
" <ip-address> or none")
|
||||
msg = _("Auto option is not available for Subnet Set. "
|
||||
"Valid options are <ip-address> or none")
|
||||
raise exceptions.CommandError(msg)
|
||||
elif gateway != 'auto':
|
||||
if gateway == 'none':
|
||||
attrs['gateway_ip'] = None
|
||||
|
@ -287,7 +287,7 @@ class SetSubnetPool(command.Command):
|
||||
|
||||
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
||||
if attrs == {}:
|
||||
msg = "Nothing specified to be set"
|
||||
msg = _("Nothing specified to be set")
|
||||
raise exceptions.CommandError(msg)
|
||||
|
||||
# Existing prefixes must be a subset of the new prefixes.
|
||||
|
Loading…
x
Reference in New Issue
Block a user