Add missing i18n marker on some help strings

Change-Id: I78b058ae26c06d83f7dea55bfcfb0df834d2eaa0
This commit is contained in:
Julie Pichon 2016-07-05 12:16:20 +01:00
parent d8b00a9517
commit 15d79ffd45
4 changed files with 66 additions and 60 deletions

View File

@ -70,7 +70,7 @@ class ValidateInstackEnv(command.Command):
parser = super(ValidateInstackEnv, self).get_parser(prog_name) parser = super(ValidateInstackEnv, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'-f', '--file', dest='instackenv', '-f', '--file', dest='instackenv',
help="Path to the instackenv.json file.", help=_("Path to the instackenv.json file."),
default='instackenv.json') default='instackenv.json')
return parser return parser
@ -152,8 +152,8 @@ class ImportBaremetal(command.Command):
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ImportBaremetal, self).get_parser(prog_name) parser = super(ImportBaremetal, self).get_parser(prog_name)
parser.add_argument('-s', '--service-host', dest='service_host', parser.add_argument('-s', '--service-host', dest='service_host',
help='Nova compute service host to register nodes ' help=_('Nova compute service host to register '
'with') 'nodes with'))
parser.add_argument( parser.add_argument(
'--json', dest='json', action='store_true', '--json', dest='json', action='store_true',
help=_('Deprecated, now detected via file extension.')) help=_('Deprecated, now detected via file extension.'))
@ -162,22 +162,24 @@ class ImportBaremetal(command.Command):
help=_('Deprecated, now detected via file extension.')) help=_('Deprecated, now detected via file extension.'))
parser.add_argument('--deploy-kernel', parser.add_argument('--deploy-kernel',
default='bm-deploy-kernel', default='bm-deploy-kernel',
help='Image with deploy kernel.') help=_('Image with deploy kernel.'))
parser.add_argument('--deploy-ramdisk', parser.add_argument('--deploy-ramdisk',
default='bm-deploy-ramdisk', default='bm-deploy-ramdisk',
help='Image with deploy ramdisk.') help=_('Image with deploy ramdisk.'))
parser.add_argument('--no-deploy-image', action='store_true', parser.add_argument('--no-deploy-image', action='store_true',
help='Skip setting the deploy kernel and ramdisk.') help=_('Skip setting the deploy kernel and '
'ramdisk.'))
parser.add_argument('--instance-boot-option', parser.add_argument('--instance-boot-option',
choices=['local', 'netboot'], default='local', choices=['local', 'netboot'], default='local',
help='Whether to set instances for booting from ' help=_('Whether to set instances for booting from '
'local hard drive (local) or network (netboot).') 'local hard drive (local) or network '
'(netboot).'))
parser.add_argument('file_in', type=argparse.FileType('r')) parser.add_argument('file_in', type=argparse.FileType('r'))
parser.add_argument( parser.add_argument(
'--initial-state', '--initial-state',
choices=['enroll', 'available'], choices=['enroll', 'available'],
default='available', default='available',
help='Provision state for newly-enrolled nodes.' help=_('Provision state for newly-enrolled nodes.')
) )
return parser return parser
@ -383,8 +385,8 @@ class ConfigureReadyState(command.Command):
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ConfigureReadyState, self).get_parser(prog_name) parser = super(ConfigureReadyState, self).get_parser(prog_name)
parser.add_argument('file', help='JSON file containing the ' parser.add_argument('file', help=_('JSON file containing the '
'ready-state configuration for each profile') 'ready-state configuration for each profile'))
return parser return parser
@ -424,24 +426,25 @@ class ConfigureBaremetalBoot(command.Command):
parser = super(ConfigureBaremetalBoot, self).get_parser(prog_name) parser = super(ConfigureBaremetalBoot, self).get_parser(prog_name)
parser.add_argument('--deploy-kernel', parser.add_argument('--deploy-kernel',
default='bm-deploy-kernel', default='bm-deploy-kernel',
help='Image with deploy kernel.') help=_('Image with deploy kernel.'))
parser.add_argument('--deploy-ramdisk', parser.add_argument('--deploy-ramdisk',
default='bm-deploy-ramdisk', default='bm-deploy-ramdisk',
help='Image with deploy ramdisk.') help=_('Image with deploy ramdisk.'))
parser.add_argument('--root-device', parser.add_argument('--root-device',
help='Define the root device for nodes. ' help=_('Define the root device for nodes. '
'Can be either a list of device names (without ' 'Can be either a list of device names '
'/dev) to choose from or one of two strategies: ' '(without /dev) to choose from or one of '
'largest or smallest. For it to work this command ' 'two strategies: largest or smallest. For '
'should be run after the introspection.') 'it to work this command should be run '
'after the introspection.'))
parser.add_argument('--root-device-minimum-size', parser.add_argument('--root-device-minimum-size',
type=int, default=4, type=int, default=4,
help='Minimum size (in GiB) of the detected ' help=_('Minimum size (in GiB) of the detected '
'root device. Used with --root-device.') 'root device. Used with --root-device.'))
parser.add_argument('--overwrite-root-device-hints', parser.add_argument('--overwrite-root-device-hints',
action='store_true', action='store_true',
help='Whether to overwrite existing root device ' help=_('Whether to overwrite existing root device '
'hints when --root-device is used.') 'hints when --root-device is used.'))
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):

View File

@ -31,6 +31,7 @@ import time
from cliff import command from cliff import command
from openstackclient.common import exceptions from openstackclient.common import exceptions
from openstackclient.common import utils from openstackclient.common import utils
from openstackclient.i18n import _
from prettytable import PrettyTable from prettytable import PrettyTable
from tripleoclient import utils as plugin_utils from tripleoclient import utils as plugin_utils
@ -224,7 +225,7 @@ class BuildOvercloudImage(command.Command):
"--all", "--all",
dest="all", dest="all",
action="store_true", action="store_true",
help="Build all images", help=_("Build all images"),
) )
image_group.add_argument( image_group.add_argument(
"--type", "--type",
@ -232,26 +233,26 @@ class BuildOvercloudImage(command.Command):
metavar='<image type>', metavar='<image type>',
choices=self.IMAGE_TYPES, choices=self.IMAGE_TYPES,
action="append", action="append",
help="Build image by name. One of " help=_("Build image by name. One of "
"%s" % ", ".join(self.IMAGE_TYPES), "%s") % ", ".join(self.IMAGE_TYPES),
) )
parser.add_argument( parser.add_argument(
"--base-image", "--base-image",
help="Image file to use as a base for new images", help=_("Image file to use as a base for new images"),
) )
parser.add_argument( parser.add_argument(
"--instack-undercloud-elements", "--instack-undercloud-elements",
dest="instack_undercloud_elements", dest="instack_undercloud_elements",
default=os.environ.get( default=os.environ.get(
"INSTACKUNDERCLOUDELEMENTS", self.INSTACKUNDERCLOUDELEMENTS), "INSTACKUNDERCLOUDELEMENTS", self.INSTACKUNDERCLOUDELEMENTS),
help="Path to Instack Undercloud elements", help=_("Path to Instack Undercloud elements"),
) )
parser.add_argument( parser.add_argument(
"--tripleo-puppet-elements", "--tripleo-puppet-elements",
dest="tripleo_puppet_elements", dest="tripleo_puppet_elements",
default=os.environ.get( default=os.environ.get(
"TRIPLEOPUPPETELEMENTS", self.TRIPLEOPUPPETELEMENTS), "TRIPLEOPUPPETELEMENTS", self.TRIPLEOPUPPETELEMENTS),
help="Path to TripleO Puppet elements", help=_("Path to TripleO Puppet elements"),
) )
parser.add_argument( parser.add_argument(
"--elements-path", "--elements-path",
@ -265,38 +266,38 @@ class BuildOvercloudImage(command.Command):
'/usr/share/openstack-heat-templates/' '/usr/share/openstack-heat-templates/'
'software-config/elements', 'software-config/elements',
])), ])),
help="Full elements path, separated by %s" % os.pathsep, help=_("Full elements path, separated by %s") % os.pathsep,
) )
parser.add_argument( parser.add_argument(
"--tmp-dir", "--tmp-dir",
dest="tmp_dir", dest="tmp_dir",
default=os.environ.get("TMP_DIR", "/var/tmp"), default=os.environ.get("TMP_DIR", "/var/tmp"),
help="Path to a temporary directory for creating images", help=_("Path to a temporary directory for creating images"),
) )
parser.add_argument( parser.add_argument(
"--node-arch", "--node-arch",
dest="node_arch", dest="node_arch",
default=os.environ.get("NODE_ARCH", "amd64"), default=os.environ.get("NODE_ARCH", "amd64"),
help="Architecture of image to build", help=_("Architecture of image to build"),
) )
parser.add_argument( parser.add_argument(
"--node-dist", "--node-dist",
dest="node_dist", dest="node_dist",
default=os.environ.get("NODE_DIST", ""), default=os.environ.get("NODE_DIST", ""),
help="Distribution of image to build", help=_("Distribution of image to build"),
) )
parser.add_argument( parser.add_argument(
"--registration-method", "--registration-method",
dest="reg_method", dest="reg_method",
default=os.environ.get("REG_METHOD", "disable"), default=os.environ.get("REG_METHOD", "disable"),
help="Registration method", help=_("Registration method"),
) )
parser.add_argument( parser.add_argument(
"--use-delorean-trunk", "--use-delorean-trunk",
dest="use_delorean_trunk", dest="use_delorean_trunk",
action='store_true', action='store_true',
default=(os.environ.get('USE_DELOREAN_TRUNK', '0') == '1'), default=(os.environ.get('USE_DELOREAN_TRUNK', '0') == '1'),
help="Use Delorean trunk repo", help=_("Use Delorean trunk repo"),
) )
parser.add_argument( parser.add_argument(
"--delorean-trunk-repo", "--delorean-trunk-repo",
@ -305,13 +306,13 @@ class BuildOvercloudImage(command.Command):
'DELOREAN_TRUNK_REPO', 'DELOREAN_TRUNK_REPO',
'http://trunk.rdoproject.org/kilo/centos7/latest-RDO-kilo-CI/' 'http://trunk.rdoproject.org/kilo/centos7/latest-RDO-kilo-CI/'
), ),
help="URL to Delorean trunk repo", help=_("URL to Delorean trunk repo"),
) )
parser.add_argument( parser.add_argument(
"--delorean-repo-file", "--delorean-repo-file",
dest="delorean_repo_file", dest="delorean_repo_file",
default=os.environ.get('DELOREAN_REPO_FILE', 'delorean-kilo.repo'), default=os.environ.get('DELOREAN_REPO_FILE', 'delorean-kilo.repo'),
help="Filename for delorean repo config file", help=_("Filename for delorean repo config file"),
) )
parser.add_argument( parser.add_argument(
"--overcloud-full-dib-extra-args", "--overcloud-full-dib-extra-args",
@ -319,7 +320,7 @@ class BuildOvercloudImage(command.Command):
default=os.environ.get( default=os.environ.get(
"OVERCLOUD_FULL_DIB_EXTRA_ARGS", "OVERCLOUD_FULL_DIB_EXTRA_ARGS",
" ".join(self.OVERCLOUD_FULL_DIB_EXTRA_ARGS)), " ".join(self.OVERCLOUD_FULL_DIB_EXTRA_ARGS)),
help="Extra args for Overcloud Full", help=_("Extra args for Overcloud Full"),
) )
parser.add_argument( parser.add_argument(
"--agent-dib-extra-args", "--agent-dib-extra-args",
@ -327,33 +328,33 @@ class BuildOvercloudImage(command.Command):
default=os.environ.get( default=os.environ.get(
"AGENT_DIB_EXTRA_ARGS", "AGENT_DIB_EXTRA_ARGS",
" ".join(self.AGENT_DIB_EXTRA_ARGS)), " ".join(self.AGENT_DIB_EXTRA_ARGS)),
help="Extra args for the IPA image", help=_("Extra args for the IPA image"),
) )
parser.add_argument( parser.add_argument(
"--overcloud-full-name", "--overcloud-full-name",
dest="overcloud_full_name", dest="overcloud_full_name",
default=os.environ.get('OVERCLOUD_FULL_NAME', 'overcloud-full'), default=os.environ.get('OVERCLOUD_FULL_NAME', 'overcloud-full'),
help="Name of overcloud full image", help=_("Name of overcloud full image"),
) )
parser.add_argument( parser.add_argument(
"--fedora-user-name", "--fedora-user-name",
dest="fedora_user_name", dest="fedora_user_name",
default=os.environ.get('FEDORA_USER_NAME', 'fedora-user'), default=os.environ.get('FEDORA_USER_NAME', 'fedora-user'),
help="Name of Fedora user image", help=_("Name of Fedora user image"),
) )
parser.add_argument( parser.add_argument(
"--agent-name", "--agent-name",
dest="agent_name", dest="agent_name",
default=os.environ.get('AGENT_NAME', 'ironic-python-agent'), default=os.environ.get('AGENT_NAME', 'ironic-python-agent'),
help="Name of the IPA ramdisk image", help=_("Name of the IPA ramdisk image"),
) )
parser.add_argument( parser.add_argument(
"--deploy-name", "--deploy-name",
dest="deploy_name", dest="deploy_name",
default=os.environ.get('DEPLOY_NAME', 'deploy-ramdisk-ironic'), default=os.environ.get('DEPLOY_NAME', 'deploy-ramdisk-ironic'),
help=("DEPRECATED: Name of deployment ramdisk image. This image " help=_("DEPRECATED: Name of deployment ramdisk image. This image "
"has been replaced by the Ironic Python Agent ramdisk, so " "has been replaced by the Ironic Python Agent ramdisk, so "
"you should switch to that as soon as possible."), "you should switch to that as soon as possible."),
) )
parser.add_argument( parser.add_argument(
"--agent-image-element", "--agent-image-element",
@ -361,7 +362,7 @@ class BuildOvercloudImage(command.Command):
default=os.environ.get( default=os.environ.get(
'AGENT_IMAGE_ELEMENT', 'AGENT_IMAGE_ELEMENT',
" ".join(self.AGENT_IMAGE_ELEMENT)), " ".join(self.AGENT_IMAGE_ELEMENT)),
help="DIB elements for the IPA image", help=_("DIB elements for the IPA image"),
) )
parser.add_argument( parser.add_argument(
"--deploy-image-element", "--deploy-image-element",
@ -369,13 +370,13 @@ class BuildOvercloudImage(command.Command):
default=os.environ.get( default=os.environ.get(
'DEPLOY_IMAGE_ELEMENT', 'DEPLOY_IMAGE_ELEMENT',
" ".join(self.DEPLOY_IMAGE_ELEMENT)), " ".join(self.DEPLOY_IMAGE_ELEMENT)),
help="DIB elements for deploy image", help=_("DIB elements for deploy image"),
) )
parser.add_argument( parser.add_argument(
"--builder-extra-args", "--builder-extra-args",
dest="builder_extra_args", dest="builder_extra_args",
default='', default='',
help="Extra arguments for the image builder", help=_("Extra arguments for the image builder"),
) )
image_group.add_argument( image_group.add_argument(
"--builder", "--builder",
@ -383,8 +384,8 @@ class BuildOvercloudImage(command.Command):
metavar='<builder>', metavar='<builder>',
choices=self._BUILDERS, choices=self._BUILDERS,
default='dib', default='dib',
help="Image builder. One of " help=_("Image builder. One of "
"%s" % ", ".join(self._BUILDERS), "%s") % ", ".join(self._BUILDERS),
) )
return parser return parser
@ -652,23 +653,23 @@ class UploadOvercloudImage(command.Command):
parser.add_argument( parser.add_argument(
"--image-path", "--image-path",
default=os.environ.get('IMAGE_PATH', './'), default=os.environ.get('IMAGE_PATH', './'),
help="Path to directory containing image files", help=_("Path to directory containing image files"),
) )
parser.add_argument( parser.add_argument(
"--os-image", "--os-image",
default=os.environ.get('OS_IMAGE', 'overcloud-full.qcow2'), default=os.environ.get('OS_IMAGE', 'overcloud-full.qcow2'),
help="OpenStack disk image filename", help=_("OpenStack disk image filename"),
) )
parser.add_argument( parser.add_argument(
"--http-boot", "--http-boot",
default=os.environ.get('HTTP_BOOT', '/httpboot'), default=os.environ.get('HTTP_BOOT', '/httpboot'),
help="Root directory for the introspection image", help=_("Root directory for the introspection image")
) )
parser.add_argument( parser.add_argument(
"--update-existing", "--update-existing",
dest="update_existing", dest="update_existing",
action="store_true", action="store_true",
help="Update images if already exist", help=_("Update images if already exist"),
) )
return parser return parser

View File

@ -20,6 +20,7 @@ import os
from cliff import command from cliff import command
import ipaddress import ipaddress
from openstackclient.i18n import _
import six import six
import yaml import yaml
@ -34,7 +35,7 @@ class ValidateOvercloudNetenv(command.Command):
parser = super(ValidateOvercloudNetenv, self).get_parser(prog_name) parser = super(ValidateOvercloudNetenv, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'-f', '--file', dest='netenv', '-f', '--file', dest='netenv',
help="Path to the network environment file", help=_("Path to the network environment file"),
default='network-environment.yaml') default='network-environment.yaml')
return parser return parser

View File

@ -17,6 +17,7 @@ import logging
from cliff import command from cliff import command
from openstackclient.common import utils from openstackclient.common import utils
from openstackclient.i18n import _
from tripleo_common import scale from tripleo_common import scale
from tripleoclient import constants from tripleoclient import constants
@ -30,21 +31,21 @@ class DeleteNode(command.Command):
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(DeleteNode, self).get_parser(prog_name) parser = super(DeleteNode, self).get_parser(prog_name)
parser.add_argument('nodes', metavar='<node>', nargs="+", parser.add_argument('nodes', metavar='<node>', nargs="+",
help='Node ID(s) to delete') help=_('Node ID(s) to delete'))
parser.add_argument('--stack', dest='stack', parser.add_argument('--stack', dest='stack',
help='Name or ID of heat stack to scale ' help=_('Name or ID of heat stack to scale '
'(default=Env: OVERCLOUD_STACK_NAME)', '(default=Env: OVERCLOUD_STACK_NAME)'),
default=utils.env('OVERCLOUD_STACK_NAME')) default=utils.env('OVERCLOUD_STACK_NAME'))
parser.add_argument( parser.add_argument(
'--templates', nargs='?', const=constants.TRIPLEO_HEAT_TEMPLATES, '--templates', nargs='?', const=constants.TRIPLEO_HEAT_TEMPLATES,
help="The directory containing the Heat templates to deploy" help=_("The directory containing the Heat templates to deploy")
) )
parser.add_argument( parser.add_argument(
'-e', '--environment-file', metavar='<HEAT ENVIRONMENT FILE>', '-e', '--environment-file', metavar='<HEAT ENVIRONMENT FILE>',
action='append', dest='environment_files', action='append', dest='environment_files',
help='Environment files to be passed to the heat stack-create ' help=_('Environment files to be passed to the heat stack-create '
'or heat stack-update command. (Can be specified more than ' 'or heat stack-update command. (Can be specified more than '
'once.)' 'once.)')
) )
return parser return parser