diff --git a/magnumclient/shell.py b/magnumclient/shell.py index 607d760..c7a8666 100644 --- a/magnumclient/shell.py +++ b/magnumclient/shell.py @@ -51,6 +51,7 @@ except ImportError: from magnumclient.common import cliutils from magnumclient import exceptions as exc +from magnumclient.i18n import _ from magnumclient.v1 import client as client_v1 from magnumclient.v1 import shell as shell_v1 from magnumclient import version @@ -242,19 +243,20 @@ class OpenStackMagnumShell(object): parser.add_argument('--debug', default=False, action='store_true', - help="Print debugging output.") + help=_("Print debugging output.")) parser.add_argument('--os-cache', default=strutils.bool_from_string( cliutils.env('OS_CACHE', default=False)), action='store_true', - help="Use the auth token cache. Defaults to False " - "if env[OS_CACHE] is not set.") + help=_("Use the auth token cache. Defaults to " + "False if env[OS_CACHE] is not set.")) parser.add_argument('--os-region-name', metavar='', default=os.environ.get('OS_REGION_NAME'), - help='Region name. Default=env[OS_REGION_NAME].') + help=_('Region name. ' + 'Default=env[OS_REGION_NAME].')) # TODO(mattf) - add get_timings support to Client @@ -273,41 +275,41 @@ class OpenStackMagnumShell(object): parser.add_argument('--os-auth-url', metavar='', default=cliutils.env('OS_AUTH_URL', default=None), - help='Defaults to env[OS_AUTH_URL].') + help=_('Defaults to env[OS_AUTH_URL].')) parser.add_argument('--os-user-id', metavar='', default=cliutils.env('OS_USER_ID', default=None), - help='Defaults to env[OS_USER_ID].') + help=_('Defaults to env[OS_USER_ID].')) parser.add_argument('--os-username', metavar='', default=cliutils.env('OS_USERNAME', default=None), - help='Defaults to env[OS_USERNAME].') + help=_('Defaults to env[OS_USERNAME].')) parser.add_argument('--os-user-domain-id', metavar='', default=cliutils.env('OS_USER_DOMAIN_ID', default=None), - help='Defaults to env[OS_USER_DOMAIN_ID].') + help=_('Defaults to env[OS_USER_DOMAIN_ID].')) parser.add_argument('--os-user-domain-name', metavar='', default=cliutils.env('OS_USER_DOMAIN_NAME', default=None), - help='Defaults to env[OS_USER_DOMAIN_NAME].') + help=_('Defaults to env[OS_USER_DOMAIN_NAME].')) parser.add_argument('--os-project-id', metavar='', default=cliutils.env('OS_PROJECT_ID', default=None), - help='Defaults to env[OS_PROJECT_ID].') + help=_('Defaults to env[OS_PROJECT_ID].')) parser.add_argument('--os-project-name', metavar='', default=cliutils.env('OS_PROJECT_NAME', default=None), - help='Defaults to env[OS_PROJECT_NAME].') + help=_('Defaults to env[OS_PROJECT_NAME].')) parser.add_argument('--os-tenant-id', metavar='', @@ -325,29 +327,30 @@ class OpenStackMagnumShell(object): metavar='', default=cliutils.env('OS_PROJECT_DOMAIN_ID', default=None), - help='Defaults to env[OS_PROJECT_DOMAIN_ID].') + help=_('Defaults to env[OS_PROJECT_DOMAIN_ID].')) parser.add_argument('--os-project-domain-name', metavar='', default=cliutils.env('OS_PROJECT_DOMAIN_NAME', default=None), - help='Defaults to env[OS_PROJECT_DOMAIN_NAME].') + help=_('Defaults to ' + 'env[OS_PROJECT_DOMAIN_NAME].')) parser.add_argument('--os-token', metavar='', default=cliutils.env('OS_TOKEN', default=None), - help='Defaults to env[OS_TOKEN].') + help=_('Defaults to env[OS_TOKEN].')) parser.add_argument('--os-password', metavar='', default=cliutils.env('OS_PASSWORD', default=None), - help='Defaults to env[OS_PASSWORD].') + help=_('Defaults to env[OS_PASSWORD].')) parser.add_argument('--service-type', metavar='', - help='Defaults to container-infra for all ' - 'actions.') + help=_('Defaults to container-infra for all ' + 'actions.')) parser.add_argument('--service_type', help=argparse.SUPPRESS) @@ -361,7 +364,7 @@ class OpenStackMagnumShell(object): metavar='', default=cliutils.env('OS_ENDPOINT_TYPE', default=None), - help='Defaults to env[OS_ENDPOINT_TYPE]') + help=_('Defaults to env[OS_ENDPOINT_TYPE]')) parser.add_argument('--os-interface', metavar='', @@ -373,7 +376,7 @@ class OpenStackMagnumShell(object): parser.add_argument('--os-cloud', metavar='', default=cliutils.env('OS_CLOUD', default=None), - help='Defaults to env[OS_CLOUD].') + help=_('Defaults to env[OS_CLOUD].')) # NOTE(dtroyer): We can't add --endpoint_type here due to argparse # thinking usage-list --end is ambiguous; but it @@ -387,24 +390,24 @@ class OpenStackMagnumShell(object): default=cliutils.env( 'MAGNUM_API_VERSION', default='latest'), - help='Accepts "api", ' - 'defaults to env[MAGNUM_API_VERSION].') + help=_('Accepts "api", ' + 'defaults to env[MAGNUM_API_VERSION].')) parser.add_argument('--magnum_api_version', help=argparse.SUPPRESS) parser.add_argument('--os-cacert', metavar='', default=cliutils.env('OS_CACERT', default=None), - help='Specify a CA bundle file to use in ' - 'verifying a TLS (https) server certificate. ' - 'Defaults to env[OS_CACERT].') + help=_('Specify a CA bundle file to use in ' + 'verifying a TLS (https) server ' + 'certificate. Defaults to env[OS_CACERT].')) parser.add_argument('--os-endpoint-override', metavar='', default=cliutils.env('OS_ENDPOINT_OVERRIDE', default=None), - help="Use this API endpoint instead of the " - "Service Catalog.") + help=_("Use this API endpoint instead of the " + "Service Catalog.")) parser.add_argument('--bypass-url', metavar='', default=cliutils.env('BYPASS_URL', default=None), @@ -417,7 +420,7 @@ class OpenStackMagnumShell(object): default=cliutils.env('MAGNUMCLIENT_INSECURE', default=False), action='store_true', - help="Do not verify https connections") + help=_("Do not verify https connections")) return parser @@ -692,7 +695,7 @@ class OpenStackMagnumShell(object): print(' '.join(commands | options)) @cliutils.arg('command', metavar='', nargs='?', - help='Display help for .') + help=_('Display help for .')) def do_help(self, args): """Display help about this program or one of its subcommands.""" # NOTE(jamespage): args.command is not guaranteed with python >= 3.4 diff --git a/magnumclient/v1/baymodels_shell.py b/magnumclient/v1/baymodels_shell.py index affa4bf..4bc4337 100644 --- a/magnumclient/v1/baymodels_shell.py +++ b/magnumclient/v1/baymodels_shell.py @@ -29,99 +29,100 @@ def _show_baymodel(baymodel): @utils.arg('--name', metavar='', - help='Name of the baymodel to create.') + help=_('Name of the baymodel to create.')) @utils.arg('--image-id', required=True, metavar='', - help='The name or UUID of the base image to customize for the bay.') + help=_('The name or UUID of the base image to customize for' + ' the bay.')) @utils.arg('--keypair-id', required=True, metavar='', - help='The name or UUID of the SSH keypair to load into the' - ' Bay nodes.') + help=_('The name or UUID of the SSH keypair to load into the' + ' Bay nodes.')) @utils.arg('--external-network-id', required=True, metavar='', - help='The external Neutron network ID to connect to this bay' - ' model.') + help=_('The external Neutron network ID to connect to this bay' + ' model.')) @utils.arg('--coe', required=True, metavar='', - help='Specify the Container Orchestration Engine to use.') + help=_('Specify the Container Orchestration Engine to use.')) @utils.arg('--fixed-network', metavar='', - help='The private Neutron network name to connect to this bay' - ' model.') + help=_('The private Neutron network name to connect to this bay' + ' model.')) @utils.arg('--fixed-subnet', metavar='', - help='The private Neutron subnet name to connect to bay.') + help=_('The private Neutron subnet name to connect to bay.')) @utils.arg('--network-driver', metavar='', - help='The network driver name for instantiating container' - ' networks.') + help=_('The network driver name for instantiating container' + ' networks.')) @utils.arg('--volume-driver', metavar='', - help='The volume driver name for instantiating container' - ' volume.') + help=_('The volume driver name for instantiating container' + ' volume.')) @utils.arg('--dns-nameserver', metavar='', default='8.8.8.8', - help='The DNS nameserver to use for this baymodel.') + help=_('The DNS nameserver to use for this baymodel.')) @utils.arg('--flavor-id', metavar='', default='m1.medium', - help='The nova flavor id to use when launching the bay.') + help=_('The nova flavor id to use when launching the bay.')) @utils.arg('--master-flavor-id', metavar='', - help='The nova flavor id to use when launching the master node ' - 'of the bay.') + help=_('The nova flavor id to use when launching the master node ' + 'of the bay.')) @utils.arg('--docker-volume-size', metavar='', type=int, - help='Specify the number of size in GB ' - 'for the docker volume to use.') + help=_('Specify the number of size in GB ' + 'for the docker volume to use.')) @utils.arg('--docker-storage-driver', metavar='', default='devicemapper', - help='Select a docker storage driver. Supported: devicemapper, ' - 'overlay. Default: devicemapper') + help=_('Select a docker storage driver. Supported: devicemapper, ' + 'overlay. Default: devicemapper')) @utils.arg('--http-proxy', metavar='', - help='The http_proxy address to use for nodes in bay.') + help=_('The http_proxy address to use for nodes in bay.')) @utils.arg('--https-proxy', metavar='', - help='The https_proxy address to use for nodes in bay.') + help=_('The https_proxy address to use for nodes in bay.')) @utils.arg('--no-proxy', metavar='', - help='The no_proxy address to use for nodes in bay.') + help=_('The no_proxy address to use for nodes in bay.')) @utils.arg('--labels', metavar='', action='append', default=[], - help='Arbitrary labels in the form of key=value pairs ' - 'to associate with a baymodel. ' - 'May be used multiple times.') + help=_('Arbitrary labels in the form of key=value pairs ' + 'to associate with a baymodel. ' + 'May be used multiple times.')) @utils.arg('--tls-disabled', action='store_true', default=False, - help='Disable TLS in the Bay.') + help=_('Disable TLS in the Bay.')) @utils.arg('--public', action='store_true', default=False, - help='Make baymodel public.') + help=_('Make baymodel public.')) @utils.arg('--registry-enabled', action='store_true', default=False, - help='Enable docker registry in the Bay') + help=_('Enable docker registry in the Bay')) @utils.arg('--server-type', metavar='', default='vm', - help='Specify the server type to be used ' - 'for example vm. For this release ' - 'default server type will be vm.') + help=_('Specify the server type to be used ' + 'for example vm. For this release ' + 'default server type will be vm.')) @utils.arg('--master-lb-enabled', action='store_true', default=False, - help='Indicates whether created bays should have a load balancer ' - 'for master nodes or not.') + help=_('Indicates whether created bays should have a load balancer ' + 'for master nodes or not.')) @utils.arg('--floating-ip-enabled', action='store_true', default=True, - help='Indicates whether created bays should have a floating ip' - 'or not.') + help=_('Indicates whether created bays should have a floating ip' + 'or not.')) @utils.deprecated(DEPRECATION_MESSAGE) def do_baymodel_create(cs, args): """Create a baymodel. @@ -161,7 +162,7 @@ def do_baymodel_create(cs, args): @utils.arg('baymodels', metavar='', nargs='+', - help='ID or name of the (baymodel)s to delete.') + help=_('ID or name of the (baymodel)s to delete.')) @utils.deprecated(DEPRECATION_MESSAGE) def do_baymodel_delete(cs, args): """Delete specified baymodel. @@ -180,7 +181,7 @@ def do_baymodel_delete(cs, args): @utils.arg('baymodel', metavar='', - help='ID or name of the baymodel to show.') + help=_('ID or name of the baymodel to show.')) @utils.deprecated(DEPRECATION_MESSAGE) def do_baymodel_show(cs, args): """Show details about the given baymodel. @@ -194,14 +195,14 @@ def do_baymodel_show(cs, args): @utils.arg('--limit', metavar='', type=int, - help='Maximum number of baymodels to return') + help=_('Maximum number of baymodels to return')) @utils.arg('--sort-key', metavar='', - help='Column to sort results by') + help=_('Column to sort results by')) @utils.arg('--sort-dir', metavar='', choices=['desc', 'asc'], - help='Direction to sort. "asc" or "desc".') + help=_('Direction to sort. "asc" or "desc".')) @utils.arg('--fields', default=None, metavar='', @@ -228,20 +229,21 @@ def do_baymodel_list(cs, args): sortby_index=None) -@utils.arg('baymodel', metavar='', help="UUID or name of baymodel") +@utils.arg('baymodel', metavar='', + help=_("UUID or name of baymodel")) @utils.arg( 'op', metavar='', choices=['add', 'replace', 'remove'], - help="Operations: 'add', 'replace' or 'remove'") + help=_("Operations: 'add', 'replace' or 'remove'")) @utils.arg( 'attributes', metavar='', nargs='+', action='append', default=[], - help="Attributes to add/replace or remove " - "(only PATH is necessary on remove)") + help=_("Attributes to add/replace or remove " + "(only PATH is necessary on remove)")) @utils.deprecated(DEPRECATION_MESSAGE) def do_baymodel_update(cs, args): """Updates one or more baymodel attributes. diff --git a/magnumclient/v1/bays_shell.py b/magnumclient/v1/bays_shell.py index 08aebd8..0836bcd 100644 --- a/magnumclient/v1/bays_shell.py +++ b/magnumclient/v1/bays_shell.py @@ -39,19 +39,19 @@ def _show_bay(bay): @utils.arg('--marker', metavar='', default=None, - help='The last bay UUID of the previous page; ' - 'displays list of bays after "marker".') + help=_('The last bay UUID of the previous page; ' + 'displays list of bays after "marker".')) @utils.arg('--limit', metavar='', type=int, - help='Maximum number of bays to return.') + help=_('Maximum number of bays to return.')) @utils.arg('--sort-key', metavar='', - help='Column to sort results by.') + help=_('Column to sort results by.')) @utils.arg('--sort-dir', metavar='', choices=['desc', 'asc'], - help='Direction to sort. "asc" or "desc".') + help=_('Direction to sort. "asc" or "desc".')) @utils.arg('--fields', default=None, metavar='', @@ -81,30 +81,30 @@ def do_bay_list(cs, args): @utils.deprecated(DEPRECATION_MESSAGE) @utils.arg('--name', metavar='', - help='Name of the bay to create.') + help=_('Name of the bay to create.')) @utils.arg('--baymodel', required=True, metavar='', - help='ID or name of the baymodel.') + help=_('ID or name of the baymodel.')) @utils.arg('--node-count', metavar='', type=int, default=1, - help='The bay node count.') + help=_('The bay node count.')) @utils.arg('--master-count', metavar='', type=int, default=1, - help='The number of master nodes for the bay.') + help=_('The number of master nodes for the bay.')) @utils.arg('--discovery-url', metavar='', - help='Specifies custom discovery url for node discovery.') + help=_('Specifies custom discovery url for node discovery.')) @utils.arg('--timeout', metavar='', type=int, default=60, - help='The timeout for bay creation in minutes. The default ' - 'is 60 minutes.') + help=_('The timeout for bay creation in minutes. The default ' + 'is 60 minutes.')) def do_bay_create(cs, args): """Create a bay. @@ -135,7 +135,7 @@ def do_bay_create(cs, args): @utils.arg('bay', metavar='', nargs='+', - help='ID or name of the (bay)s to delete.') + help=_('ID or name of the (bay)s to delete.')) @utils.deprecated(DEPRECATION_MESSAGE) def do_bay_delete(cs, args): """Delete specified bay. @@ -154,10 +154,10 @@ def do_bay_delete(cs, args): @utils.arg('bay', metavar='', - help='ID or name of the bay to show.') + help=_('ID or name of the bay to show.')) @utils.arg('--long', action='store_true', default=False, - help='Display extra associated Baymodel info.') + help=_('Display extra associated Baymodel info.')) @utils.deprecated(DEPRECATION_MESSAGE) def do_bay_show(cs, args): """Show details about the given bay. @@ -175,23 +175,23 @@ def do_bay_show(cs, args): _show_bay(bay) -@utils.arg('bay', metavar='', help="UUID or name of bay") +@utils.arg('bay', metavar='', help=_("UUID or name of bay")) @utils.arg('--rollback', action='store_true', default=False, - help='Rollback bay on update failure.') + help=_('Rollback bay on update failure.')) @utils.arg( 'op', metavar='', choices=['add', 'replace', 'remove'], - help="Operations: 'add', 'replace' or 'remove'") + help=_("Operations: 'add', 'replace' or 'remove'")) @utils.arg( 'attributes', metavar='', nargs='+', action='append', default=[], - help="Attributes to add/replace or remove " - "(only PATH is necessary on remove)") + help=_("Attributes to add/replace or remove " + "(only PATH is necessary on remove)")) @utils.deprecated(DEPRECATION_MESSAGE) def do_bay_update(cs, args): """Update information about the given bay. @@ -213,14 +213,14 @@ def do_bay_update(cs, args): @utils.arg('bay', metavar='', - help='ID or name of the bay to retrieve config.') + help=_('ID or name of the bay to retrieve config.')) @utils.arg('--dir', metavar='', default='.', - help='Directory to save the certificate and config files.') + help=_('Directory to save the certificate and config files.')) @utils.arg('--force', action='store_true', default=False, - help='Overwrite files if existing.') + help=_('Overwrite files if existing.')) @utils.deprecated(DEPRECATION_MESSAGE) def do_bay_config(cs, args): """Configure native client to access bay. diff --git a/magnumclient/v1/certificates_shell.py b/magnumclient/v1/certificates_shell.py index ef6d032..c186241 100644 --- a/magnumclient/v1/certificates_shell.py +++ b/magnumclient/v1/certificates_shell.py @@ -15,6 +15,7 @@ import os.path from magnumclient.common import cliutils as utils +from magnumclient.i18n import _ DEPRECATION_MESSAGE = ( @@ -41,11 +42,11 @@ def _get_target_uuid(cs, args): @utils.arg('--bay', required=False, metavar='', - help='ID or name of the bay.') + help=_('ID or name of the bay.')) @utils.arg('--cluster', required=False, metavar='', - help='ID or name of the cluster.') + help=_('ID or name of the cluster.')) def do_ca_show(cs, args): """Show details about the CA certificate for a bay or cluster.""" opts = { @@ -58,15 +59,16 @@ def do_ca_show(cs, args): @utils.arg('--csr', metavar='', - help='File path of the csr file to send to Magnum to get signed.') + help=_('File path of the csr file to send to Magnum' + ' to get signed.')) @utils.arg('--bay', required=False, metavar='', - help='ID or name of the bay.') + help=_('ID or name of the bay.')) @utils.arg('--cluster', required=False, metavar='', - help='ID or name of the cluster.') + help=_('ID or name of the cluster.')) def do_ca_sign(cs, args): """Generate the CA certificate for a bay or cluster.""" opts = { diff --git a/magnumclient/v1/cluster_templates_shell.py b/magnumclient/v1/cluster_templates_shell.py index 4bccf84..9782aeb 100644 --- a/magnumclient/v1/cluster_templates_shell.py +++ b/magnumclient/v1/cluster_templates_shell.py @@ -35,7 +35,7 @@ def _show_cluster_template(cluster_template): @utils.deprecation_map(DEPRECATING_PARAMS) @utils.arg('--name', metavar='', - help='Name of the cluster template to create.') + help=_('Name of the cluster template to create.')) @utils.arg('--image-id', dest='image', required=True, @@ -47,8 +47,8 @@ def _show_cluster_template(cluster_template): dest='image', required=True, metavar='', - help='The name or UUID of the base image to customize for the ' - 'Cluster.') + help=_('The name or UUID of the base image to customize for the ' + 'Cluster.')) @utils.arg('--keypair-id', dest='keypair', metavar='', @@ -58,8 +58,8 @@ def _show_cluster_template(cluster_template): @utils.arg('--keypair', dest='keypair', metavar='', - help='The name or UUID of the SSH keypair to load into the Cluster ' - 'nodes.') + help=_('The name or UUID of the SSH keypair to load into the ' + 'Cluster nodes.')) @utils.arg('--external-network-id', dest='external_network', required=True, @@ -71,31 +71,31 @@ def _show_cluster_template(cluster_template): dest='external_network', required=True, metavar='', - help='The external Neutron network name or UUID to connect to ' - 'this Cluster Template.') + help=_('The external Neutron network name or UUID to connect to ' + 'this Cluster Template.')) @utils.arg('--coe', required=True, metavar='', - help='Specify the Container Orchestration Engine to use.') + help=_('Specify the Container Orchestration Engine to use.')) @utils.arg('--fixed-network', metavar='', - help='The private Neutron network name to connect to this Cluster' - ' model.') + help=_('The private Neutron network name to connect to this Cluster' + ' model.')) @utils.arg('--fixed-subnet', metavar='', - help='The private Neutron subnet name to connect to Cluster.') + help=_('The private Neutron subnet name to connect to Cluster.')) @utils.arg('--network-driver', metavar='', - help='The network driver name for instantiating container' - ' networks.') + help=_('The network driver name for instantiating container' + ' networks.')) @utils.arg('--volume-driver', metavar='', - help='The volume driver name for instantiating container' - ' volume.') + help=_('The volume driver name for instantiating container' + ' volume.')) @utils.arg('--dns-nameserver', metavar='', default='8.8.8.8', - help='The DNS nameserver to use for this cluster template.') + help=_('The DNS nameserver to use for this cluster template.')) @utils.arg('--flavor-id', dest='flavor', metavar='', @@ -107,8 +107,8 @@ def _show_cluster_template(cluster_template): dest='flavor', metavar='', default='m1.medium', - help='The nova flavor name or UUID to use when launching the ' - 'Cluster.') + help=_('The nova flavor name or UUID to use when launching the ' + 'Cluster.')) @utils.arg('--master-flavor-id', dest='master_flavor', metavar='', @@ -118,55 +118,55 @@ def _show_cluster_template(cluster_template): @utils.arg('--master-flavor', dest='master_flavor', metavar='', - help='The nova flavor name or UUID to use when launching the master' - ' node of the Cluster.') + help=_('The nova flavor name or UUID to use when launching the' + ' master node of the Cluster.')) @utils.arg('--docker-volume-size', metavar='', type=int, - help='Specify the number of size in GB ' - 'for the docker volume to use.') + help=_('Specify the number of size in GB ' + 'for the docker volume to use.')) @utils.arg('--docker-storage-driver', metavar='', default='devicemapper', - help='Select a docker storage driver. Supported: devicemapper, ' - 'overlay. Default: devicemapper') + help=_('Select a docker storage driver. Supported: devicemapper, ' + 'overlay. Default: devicemapper')) @utils.arg('--http-proxy', metavar='', - help='The http_proxy address to use for nodes in Cluster.') + help=_('The http_proxy address to use for nodes in Cluster.')) @utils.arg('--https-proxy', metavar='', - help='The https_proxy address to use for nodes in Cluster.') + help=_('The https_proxy address to use for nodes in Cluster.')) @utils.arg('--no-proxy', metavar='', - help='The no_proxy address to use for nodes in Cluster.') + help=_('The no_proxy address to use for nodes in Cluster.')) @utils.arg('--labels', metavar='', action='append', default=[], - help='Arbitrary labels in the form of key=value pairs ' - 'to associate with a cluster template. ' - 'May be used multiple times.') + help=_('Arbitrary labels in the form of key=value pairs ' + 'to associate with a cluster template. ' + 'May be used multiple times.')) @utils.arg('--tls-disabled', action='store_true', default=False, - help='Disable TLS in the Cluster.') + help=_('Disable TLS in the Cluster.')) @utils.arg('--public', action='store_true', default=False, - help='Make cluster template public.') + help=_('Make cluster template public.')) @utils.arg('--registry-enabled', action='store_true', default=False, - help='Enable docker registry in the Cluster') + help=_('Enable docker registry in the Cluster')) @utils.arg('--server-type', metavar='', default='vm', - help='Specify the server type to be used ' - 'for example vm. For this release ' - 'default server type will be vm.') + help=_('Specify the server type to be used ' + 'for example vm. For this release ' + 'default server type will be vm.')) @utils.arg('--master-lb-enabled', action='store_true', default=False, - help='Indicates whether created Clusters should have a load ' - 'balancer for master nodes or not.') + help=_('Indicates whether created Clusters should have a load ' + 'balancer for master nodes or not.')) @utils.arg('--floating-ip-enabled', action='store_true', default=True, - help='Indicates whether created Clusters should have a floating ip' - 'or not.') + help=_('Indicates whether created Clusters should have a ' + 'floating ip or not.')) def do_cluster_template_create(cs, args): """Create a cluster template.""" opts = {} @@ -202,7 +202,7 @@ def do_cluster_template_create(cs, args): @utils.arg('cluster_templates', metavar='', nargs='+', - help='ID or name of the (cluster template)s to delete.') + help=_('ID or name of the (cluster template)s to delete.')) def do_cluster_template_delete(cs, args): """Delete specified cluster template.""" for cluster_template in args.cluster_templates: @@ -218,7 +218,7 @@ def do_cluster_template_delete(cs, args): @utils.arg('cluster_template', metavar='', - help='ID or name of the cluster template to show.') + help=_('ID or name of the cluster template to show.')) def do_cluster_template_show(cs, args): """Show details about the given cluster template.""" cluster_template = cs.cluster_templates.get(args.cluster_template) @@ -228,14 +228,14 @@ def do_cluster_template_show(cs, args): @utils.arg('--limit', metavar='', type=int, - help='Maximum number of cluster templates to return') + help=_('Maximum number of cluster templates to return')) @utils.arg('--sort-key', metavar='', - help='Column to sort results by') + help=_('Column to sort results by')) @utils.arg('--sort-dir', metavar='', choices=['desc', 'asc'], - help='Direction to sort. "asc" or "desc".') + help=_('Direction to sort. "asc" or "desc".')) @utils.arg('--fields', default=None, metavar='', @@ -260,20 +260,20 @@ def do_cluster_template_list(cs, args): @utils.arg('cluster_template', metavar='', - help="UUID or name of cluster template") + help=_("UUID or name of cluster template")) @utils.arg( 'op', metavar='', choices=['add', 'replace', 'remove'], - help="Operations: 'add', 'replace' or 'remove'") + help=_("Operations: 'add', 'replace' or 'remove'")) @utils.arg( 'attributes', metavar='', nargs='+', action='append', default=[], - help="Attributes to add/replace or remove " - "(only PATH is necessary on remove)") + help=_("Attributes to add/replace or remove " + "(only PATH is necessary on remove)")) def do_cluster_template_update(cs, args): """Updates one or more cluster template attributes.""" patch = magnum_utils.args_array_to_patch(args.op, args.attributes[0]) diff --git a/magnumclient/v1/clusters_shell.py b/magnumclient/v1/clusters_shell.py index c78bd9b..d96ec26 100644 --- a/magnumclient/v1/clusters_shell.py +++ b/magnumclient/v1/clusters_shell.py @@ -42,19 +42,19 @@ def _show_cluster(cluster): @utils.arg('--marker', metavar='', default=None, - help='The last cluster UUID of the previous page; ' - 'displays list of clusters after "marker".') + help=_('The last cluster UUID of the previous page; ' + 'displays list of clusters after "marker".')) @utils.arg('--limit', metavar='', type=int, - help='Maximum number of clusters to return.') + help=_('Maximum number of clusters to return.')) @utils.arg('--sort-key', metavar='', - help='Column to sort results by.') + help=_('Column to sort results by.')) @utils.arg('--sort-dir', metavar='', choices=['desc', 'asc'], - help='Direction to sort. "asc" or "desc".') + help=_('Direction to sort. "asc" or "desc".')) @utils.arg('--fields', default=None, metavar='', @@ -84,11 +84,11 @@ def do_cluster_list(cs, args): @utils.deprecation_map(DEPRECATING_PARAMS) @utils.arg('--name', metavar='', - help='Name of the cluster to create.') + help=_('Name of the cluster to create.')) @utils.arg('--cluster-template', required=True, metavar='', - help='ID or name of the cluster template.') + help=_('ID or name of the cluster template.')) @utils.arg('--keypair-id', dest='keypair', metavar='', @@ -100,26 +100,26 @@ def do_cluster_list(cs, args): dest='keypair', metavar='', default=None, - help='UUID or name of the keypair to use for this cluster.') + help=_('UUID or name of the keypair to use for this cluster.')) @utils.arg('--node-count', metavar='', type=int, default=1, - help='The cluster node count.') + help=_('The cluster node count.')) @utils.arg('--master-count', metavar='', type=int, default=1, - help='The number of master nodes for the cluster.') + help=_('The number of master nodes for the cluster.')) @utils.arg('--discovery-url', metavar='', - help='Specifies custom discovery url for node discovery.') + help=_('Specifies custom discovery url for node discovery.')) @utils.arg('--timeout', metavar='', type=int, default=60, - help='The timeout for cluster creation in minutes. The default ' - 'is 60 minutes.') + help=_('The timeout for cluster creation in minutes. The default ' + 'is 60 minutes.')) def do_cluster_create(cs, args): """Create a cluster.""" @@ -149,7 +149,7 @@ def do_cluster_create(cs, args): @utils.arg('cluster', metavar='', nargs='+', - help='ID or name of the (cluster)s to delete.') + help=_('ID or name of the (cluster)s to delete.')) def do_cluster_delete(cs, args): """Delete specified cluster.""" for id in args.cluster: @@ -164,10 +164,10 @@ def do_cluster_delete(cs, args): @utils.arg('cluster', metavar='', - help='ID or name of the cluster to show.') + help=_('ID or name of the cluster to show.')) @utils.arg('--long', action='store_true', default=False, - help='Display extra associated cluster template info.') + help=_('Display extra associated cluster template info.')) def do_cluster_show(cs, args): """Show details about the given cluster.""" cluster = cs.clusters.get(args.cluster) @@ -183,23 +183,23 @@ def do_cluster_show(cs, args): _show_cluster(cluster) -@utils.arg('cluster', metavar='', help="UUID or name of cluster") +@utils.arg('cluster', metavar='', help=_("UUID or name of cluster")) @utils.arg('--rollback', action='store_true', default=False, - help='Rollback cluster on update failure.') + help=_('Rollback cluster on update failure.')) @utils.arg( 'op', metavar='', choices=['add', 'replace', 'remove'], - help="Operations: 'add', 'replace' or 'remove'") + help=_("Operations: 'add', 'replace' or 'remove'")) @utils.arg( 'attributes', metavar='', nargs='+', action='append', default=[], - help="Attributes to add/replace or remove " - "(only PATH is necessary on remove)") + help=_("Attributes to add/replace or remove " + "(only PATH is necessary on remove)")) def do_cluster_update(cs, args): """Update information about the given cluster.""" if args.rollback and args.magnum_api_version and \ @@ -217,14 +217,14 @@ def do_cluster_update(cs, args): @utils.arg('cluster', metavar='', - help='ID or name of the cluster to retrieve config.') + help=_('ID or name of the cluster to retrieve config.')) @utils.arg('--dir', metavar='', default='.', - help='Directory to save the certificate and config files.') + help=_('Directory to save the certificate and config files.')) @utils.arg('--force', action='store_true', default=False, - help='Overwrite files if existing.') + help=_('Overwrite files if existing.')) def do_cluster_config(cs, args): """Configure native client to access cluster.