From ff51384fc119669822313c064d9ab0fd6b453bce Mon Sep 17 00:00:00 2001 From: stephane Date: Tue, 30 Jun 2015 15:07:28 -0700 Subject: [PATCH] Enable translation for config option help messages Several OpenStack projects wrap help messages for translation. Follow suit by wrapping the help messages. Change-Id: I38572dfa40b3cb10b1c58d9b555985c58afd70aa Closes-Bug: #1413830 --- ironic/api/__init__.py | 9 +- ironic/api/app.py | 11 +- ironic/cmd/dbsync.py | 23 ++-- ironic/common/dhcp_factory.py | 7 +- ironic/common/disk_partitioner.py | 16 +-- ironic/common/driver_factory.py | 19 +-- ironic/common/exception.py | 8 +- .../common/glance_service/v2/image_service.py | 91 +++++++------ ironic/common/hash_ring.py | 36 +++--- ironic/common/image_service.py | 28 ++-- ironic/common/images.py | 10 +- ironic/common/keystone.py | 4 +- ironic/common/paths.py | 9 +- ironic/common/service.py | 13 +- ironic/common/swift.py | 4 +- ironic/common/utils.py | 8 +- ironic/conductor/manager.py | 122 +++++++++--------- ironic/db/sqlalchemy/models.py | 3 +- ironic/dhcp/neutron.py | 22 ++-- ironic/drivers/modules/agent.py | 27 ++-- ironic/drivers/modules/agent_base_vendor.py | 12 +- ironic/drivers/modules/agent_client.py | 4 +- ironic/drivers/modules/amt/common.py | 4 +- ironic/drivers/modules/amt/power.py | 8 +- ironic/drivers/modules/console_utils.py | 19 +-- ironic/drivers/modules/deploy_utils.py | 10 +- ironic/drivers/modules/drac/client.py | 13 +- ironic/drivers/modules/ilo/common.py | 10 +- ironic/drivers/modules/ilo/deploy.py | 6 +- ironic/drivers/modules/ilo/management.py | 23 ++-- ironic/drivers/modules/ilo/power.py | 7 +- ironic/drivers/modules/image_cache.py | 5 +- ironic/drivers/modules/inspector.py | 12 +- ironic/drivers/modules/ipminative.py | 20 +-- ironic/drivers/modules/irmc/common.py | 13 +- ironic/drivers/modules/iscsi_deploy.py | 24 ++-- ironic/drivers/modules/pxe.py | 32 ++--- ironic/drivers/modules/seamicro.py | 4 +- ironic/drivers/modules/snmp.py | 2 +- ironic/drivers/modules/ssh.py | 2 +- ironic/drivers/modules/ucs/power.py | 7 +- ironic/drivers/modules/virtualbox.py | 2 +- ironic/netconf.py | 8 +- 43 files changed, 369 insertions(+), 348 deletions(-) diff --git a/ironic/api/__init__.py b/ironic/api/__init__.py index eb9e8e751f..f1fedc5340 100644 --- a/ironic/api/__init__.py +++ b/ironic/api/__init__.py @@ -15,18 +15,19 @@ from oslo_config import cfg +from ironic.common.i18n import _ API_SERVICE_OPTS = [ cfg.StrOpt('host_ip', default='0.0.0.0', - help='The IP address on which ironic-api listens.'), + help=_('The IP address on which ironic-api listens.')), cfg.IntOpt('port', default=6385, - help='The TCP port on which ironic-api listens.'), + help=_('The TCP port on which ironic-api listens.')), cfg.IntOpt('max_limit', default=1000, - help='The maximum number of items returned in a single ' - 'response from a collection resource.'), + help=_('The maximum number of items returned in a single ' + 'response from a collection resource.')), ] CONF = cfg.CONF diff --git a/ironic/api/app.py b/ironic/api/app.py index 5bc932fba5..4307c6aaeb 100644 --- a/ironic/api/app.py +++ b/ironic/api/app.py @@ -22,18 +22,19 @@ from ironic.api import acl from ironic.api import config from ironic.api import hooks from ironic.api import middleware +from ironic.common.i18n import _ api_opts = [ cfg.StrOpt( 'auth_strategy', default='keystone', - help='Authentication strategy used by ironic-api: one of "keystone" ' - 'or "noauth". "noauth" should not be used in a production ' - 'environment because all authentication will be disabled.'), + help=_('Authentication strategy used by ironic-api: one of "keystone" ' + 'or "noauth". "noauth" should not be used in a production ' + 'environment because all authentication will be disabled.')), cfg.BoolOpt('pecan_debug', default=False, - help=('Enable pecan debug mode. WARNING: this is insecure ' - 'and should not be used in a production environment.')), + help=_('Enable pecan debug mode. WARNING: this is insecure ' + 'and should not be used in a production environment.')), ] CONF = cfg.CONF diff --git a/ironic/cmd/dbsync.py b/ironic/cmd/dbsync.py index 55df715511..b5b3dc27f9 100644 --- a/ironic/cmd/dbsync.py +++ b/ironic/cmd/dbsync.py @@ -23,6 +23,7 @@ import sys from oslo_config import cfg +from ironic.common.i18n import _ from ironic.common import service from ironic.db import migration @@ -56,17 +57,17 @@ def add_command_parsers(subparsers): parser = subparsers.add_parser( 'upgrade', - help="Upgrade the database schema to the latest version. " - "Optionally, use --revision to specify an alembic revision " - "string to upgrade to.") + help=_("Upgrade the database schema to the latest version. " + "Optionally, use --revision to specify an alembic revision " + "string to upgrade to.")) parser.set_defaults(func=command_object.upgrade) parser.add_argument('--revision', nargs='?') parser = subparsers.add_parser( 'downgrade', - help="Downgrade the database schema to the oldest revision. " - "While optional, one should generally use --revision to " - "specify the alembic revision string to downgrade to.") + help=_("Downgrade the database schema to the oldest revision. " + "While optional, one should generally use --revision to " + "specify the alembic revision string to downgrade to.")) parser.set_defaults(func=command_object.downgrade) parser.add_argument('--revision', nargs='?') @@ -76,26 +77,26 @@ def add_command_parsers(subparsers): parser = subparsers.add_parser( 'revision', - help="Create a new alembic revision. " - "Use --message to set the message string.") + help=_("Create a new alembic revision. " + "Use --message to set the message string.")) parser.add_argument('-m', '--message') parser.add_argument('--autogenerate', action='store_true') parser.set_defaults(func=command_object.revision) parser = subparsers.add_parser( 'version', - help="Print the current version information and exit.") + help=_("Print the current version information and exit.")) parser.set_defaults(func=command_object.version) parser = subparsers.add_parser( 'create_schema', - help="Create the database schema.") + help=_("Create the database schema.")) parser.set_defaults(func=command_object.create_schema) command_opt = cfg.SubCommandOpt('command', title='Command', - help='Available commands', + help=_('Available commands'), handler=add_command_parsers) CONF.register_cli_opt(command_opt) diff --git a/ironic/common/dhcp_factory.py b/ironic/common/dhcp_factory.py index 4e81accad4..3b37def73d 100644 --- a/ironic/common/dhcp_factory.py +++ b/ironic/common/dhcp_factory.py @@ -17,14 +17,13 @@ from oslo_config import cfg import stevedore from ironic.common import exception - +from ironic.common.i18n import _ dhcp_provider_opts = [ cfg.StrOpt('dhcp_provider', default='neutron', - help='DHCP provider to use. "neutron" uses Neutron, and ' - '"none" uses a no-op provider.' - ), + help=_('DHCP provider to use. "neutron" uses Neutron, and ' + '"none" uses a no-op provider.')), ] CONF = cfg.CONF diff --git a/ironic/common/disk_partitioner.py b/ironic/common/disk_partitioner.py index e17d225f61..f6b2e6b538 100644 --- a/ironic/common/disk_partitioner.py +++ b/ironic/common/disk_partitioner.py @@ -28,16 +28,16 @@ from ironic.common import utils opts = [ cfg.IntOpt('check_device_interval', default=1, - help='After Ironic has completed creating the partition table, ' - 'it continues to check for activity on the attached iSCSI ' - 'device status at this interval prior to copying the image' - ' to the node, in seconds'), + help=_('After Ironic has completed creating the partition ' + 'table, it continues to check for activity on the ' + 'attached iSCSI device status at this interval prior ' + 'to copying the image to the node, in seconds')), cfg.IntOpt('check_device_max_retries', default=20, - help='The maximum number of times to check that the device is ' - 'not accessed by another process. If the device is still ' - 'busy after that, the disk partitioning will be treated as' - ' having failed.'), + help=_('The maximum number of times to check that the device ' + 'is not accessed by another process. If the device is ' + 'still busy after that, the disk partitioning will be ' + 'treated as having failed.')), ] CONF = cfg.CONF diff --git a/ironic/common/driver_factory.py b/ironic/common/driver_factory.py index cc6439750a..a11dc3f68c 100644 --- a/ironic/common/driver_factory.py +++ b/ironic/common/driver_factory.py @@ -19,6 +19,7 @@ from oslo_log import log from stevedore import dispatch from ironic.common import exception +from ironic.common.i18n import _ from ironic.common.i18n import _LI @@ -27,15 +28,15 @@ LOG = log.getLogger(__name__) driver_opts = [ cfg.ListOpt('enabled_drivers', default=['pxe_ipmitool'], - help='Specify the list of drivers to load during service ' - 'initialization. Missing drivers, or drivers which ' - 'fail to initialize, will prevent the conductor ' - 'service from starting. The option default is a ' - 'recommended set of production-oriented drivers. A ' - 'complete list of drivers present on your system may ' - 'be found by enumerating the "ironic.drivers" ' - 'entrypoint. An example may be found in the ' - 'developer documentation online.'), + help=_('Specify the list of drivers to load during service ' + 'initialization. Missing drivers, or drivers which ' + 'fail to initialize, will prevent the conductor ' + 'service from starting. The option default is a ' + 'recommended set of production-oriented drivers. A ' + 'complete list of drivers present on your system may ' + 'be found by enumerating the "ironic.drivers" ' + 'entrypoint. An example may be found in the ' + 'developer documentation online.')), ] CONF = cfg.CONF diff --git a/ironic/common/exception.py b/ironic/common/exception.py index f4cfc4d83c..807d9823b1 100644 --- a/ironic/common/exception.py +++ b/ironic/common/exception.py @@ -35,10 +35,10 @@ LOG = logging.getLogger(__name__) exc_log_opts = [ cfg.BoolOpt('fatal_exception_format_errors', default=False, - help='Used if there is a formatting error when generating an ' - 'exception message (a programming error). If True, ' - 'raise an exception; if False, use the unformatted ' - 'message.'), + help=_('Used if there is a formatting error when generating ' + 'an exception message (a programming error). If True, ' + 'raise an exception; if False, use the unformatted ' + 'message.')), ] CONF = cfg.CONF diff --git a/ironic/common/glance_service/v2/image_service.py b/ironic/common/glance_service/v2/image_service.py index fa0e373778..4f984a1993 100644 --- a/ironic/common/glance_service/v2/image_service.py +++ b/ironic/common/glance_service/v2/image_service.py @@ -27,57 +27,62 @@ from ironic.common.i18n import _ glance_opts = [ cfg.ListOpt('allowed_direct_url_schemes', default=[], - help='A list of URL schemes that can be downloaded directly ' - 'via the direct_url. Currently supported schemes: ' - '[file].'), + help=_('A list of URL schemes that can be downloaded directly ' + 'via the direct_url. Currently supported schemes: ' + '[file].')), # To upload this key to Swift: # swift post -m Temp-Url-Key:correcthorsebatterystaple cfg.StrOpt('swift_temp_url_key', - help='The secret token given to Swift to allow temporary URL ' - 'downloads. Required for temporary URLs.', + help=_('The secret token given to Swift to allow temporary URL ' + 'downloads. Required for temporary URLs.'), secret=True), cfg.IntOpt('swift_temp_url_duration', default=1200, - help='The length of time in seconds that the temporary URL ' - 'will be valid for. Defaults to 20 minutes. If some ' - 'deploys get a 401 response code when trying to download ' - 'from the temporary URL, try raising this duration.'), - cfg.StrOpt('swift_endpoint_url', - help='The "endpoint" (scheme, hostname, optional port) for ' - 'the Swift URL of the form ' - '"endpoint_url/api_version/account/container/object_id". ' - 'Do not include trailing "/". ' - 'For example, use "https://swift.example.com". ' - 'Required for temporary URLs.'), - cfg.StrOpt('swift_api_version', - default='v1', - help='The Swift API version to create a temporary URL for. ' - 'Defaults to "v1". Swift temporary URL format: ' - '"endpoint_url/api_version/account/container/object_id"'), - cfg.StrOpt('swift_account', - help='The account that Glance uses to communicate with ' - 'Swift. The format is "AUTH_uuid". "uuid" is the ' - 'UUID for the account configured in the glance-api.conf. ' - 'Required for temporary URLs. For example: ' - '"AUTH_a422b2-91f3-2f46-74b7-d7c9e8958f5d30". ' - 'Swift temporary URL format: ' - '"endpoint_url/api_version/account/container/object_id"'), - cfg.StrOpt('swift_container', - default='glance', - help='The Swift container Glance is configured to store its ' - 'images in. Defaults to "glance", which is the default ' - 'in glance-api.conf. ' - 'Swift temporary URL format: ' - '"endpoint_url/api_version/account/container/object_id"'), + help=_('The length of time in seconds that the temporary URL ' + 'will be valid for. Defaults to 20 minutes. If some ' + 'deploys get a 401 response code when trying to ' + 'download from the temporary URL, try raising this ' + 'duration.')), + cfg.StrOpt( + 'swift_endpoint_url', + help=_('The "endpoint" (scheme, hostname, optional port) for ' + 'the Swift URL of the form ' + '"endpoint_url/api_version/account/container/object_id". ' + 'Do not include trailing "/". ' + 'For example, use "https://swift.example.com". ' + 'Required for temporary URLs.')), + cfg.StrOpt( + 'swift_api_version', + default='v1', + help=_('The Swift API version to create a temporary URL for. ' + 'Defaults to "v1". Swift temporary URL format: ' + '"endpoint_url/api_version/account/container/object_id"')), + cfg.StrOpt( + 'swift_account', + help=_('The account that Glance uses to communicate with ' + 'Swift. The format is "AUTH_uuid". "uuid" is the ' + 'UUID for the account configured in the glance-api.conf. ' + 'Required for temporary URLs. For example: ' + '"AUTH_a422b2-91f3-2f46-74b7-d7c9e8958f5d30". ' + 'Swift temporary URL format: ' + '"endpoint_url/api_version/account/container/object_id"')), + cfg.StrOpt( + 'swift_container', + default='glance', + help=_('The Swift container Glance is configured to store its ' + 'images in. Defaults to "glance", which is the default ' + 'in glance-api.conf. ' + 'Swift temporary URL format: ' + '"endpoint_url/api_version/account/container/object_id"')), cfg.IntOpt('swift_store_multiple_containers_seed', default=0, - help='This should match a config by the same name in the ' - 'Glance configuration file. When set to 0, a ' - 'single-tenant store will only use one ' - 'container to store all images. When set to an integer ' - 'value between 1 and 32, a single-tenant store will use ' - 'multiple containers to store images, and this value ' - 'will determine how many containers are created.'), + help=_('This should match a config by the same name in the ' + 'Glance configuration file. When set to 0, a ' + 'single-tenant store will only use one ' + 'container to store all images. When set to an integer ' + 'value between 1 and 32, a single-tenant store will use ' + 'multiple containers to store images, and this value ' + 'will determine how many containers are created.')), ] CONF = cfg.CONF diff --git a/ironic/common/hash_ring.py b/ironic/common/hash_ring.py index 2602ddcfbf..b345251caa 100644 --- a/ironic/common/hash_ring.py +++ b/ironic/common/hash_ring.py @@ -27,26 +27,26 @@ from ironic.db import api as dbapi hash_opts = [ cfg.IntOpt('hash_partition_exponent', default=5, - help='Exponent to determine number of hash partitions to use ' - 'when distributing load across conductors. Larger values ' - 'will result in more even distribution of load and less ' - 'load when rebalancing the ring, but more memory usage. ' - 'Number of partitions per conductor is ' - '(2^hash_partition_exponent). This determines the ' - 'granularity of rebalancing: given 10 hosts, and an ' - 'exponent of the 2, there are 40 partitions in the ring.' - 'A few thousand partitions should make rebalancing ' - 'smooth in most cases. The default is suitable for up to ' - 'a few hundred conductors. Too many partitions has a CPU ' - 'impact.'), + help=_('Exponent to determine number of hash partitions to use ' + 'when distributing load across conductors. Larger ' + 'values will result in more even distribution of load ' + 'and less load when rebalancing the ring, but more ' + 'memory usage. Number of partitions per conductor is ' + '(2^hash_partition_exponent). This determines the ' + 'granularity of rebalancing: given 10 hosts, and an ' + 'exponent of the 2, there are 40 partitions in the ring.' + 'A few thousand partitions should make rebalancing ' + 'smooth in most cases. The default is suitable for up ' + 'to a few hundred conductors. Too many partitions has a ' + 'CPU impact.')), cfg.IntOpt('hash_distribution_replicas', default=1, - help='[Experimental Feature] ' - 'Number of hosts to map onto each hash partition. ' - 'Setting this to more than one will cause additional ' - 'conductor services to prepare deployment environments ' - 'and potentially allow the Ironic cluster to recover ' - 'more quickly if a conductor instance is terminated.'), + help=_('[Experimental Feature] ' + 'Number of hosts to map onto each hash partition. ' + 'Setting this to more than one will cause additional ' + 'conductor services to prepare deployment environments ' + 'and potentially allow the Ironic cluster to recover ' + 'more quickly if a conductor instance is terminated.')), ] CONF = cfg.CONF diff --git a/ironic/common/image_service.py b/ironic/common/image_service.py index d7a963051b..e0e2c05c68 100644 --- a/ironic/common/image_service.py +++ b/ironic/common/image_service.py @@ -44,31 +44,31 @@ CONF.import_opt('my_ip', 'ironic.netconf') glance_opts = [ cfg.StrOpt('glance_host', default='$my_ip', - help='Default glance hostname or IP address.'), + help=_('Default glance hostname or IP address.')), cfg.IntOpt('glance_port', default=9292, - help='Default glance port.'), + help=_('Default glance port.')), cfg.StrOpt('glance_protocol', default='http', - help='Default protocol to use when connecting to glance. ' - 'Set to https for SSL.'), + help=_('Default protocol to use when connecting to glance. ' + 'Set to https for SSL.')), cfg.ListOpt('glance_api_servers', - help='A list of the glance api servers available to ironic. ' - 'Prefix with https:// for SSL-based glance API servers. ' - 'Format is [hostname|IP]:port.'), + help=_('A list of the glance api servers available to ironic. ' + 'Prefix with https:// for SSL-based glance API ' + 'servers. Format is [hostname|IP]:port.')), cfg.BoolOpt('glance_api_insecure', default=False, - help='Allow to perform insecure SSL (https) requests to ' - 'glance.'), + help=_('Allow to perform insecure SSL (https) requests to ' + 'glance.')), cfg.IntOpt('glance_num_retries', default=0, - help='Number of retries when downloading an image from ' - 'glance.'), + help=_('Number of retries when downloading an image from ' + 'glance.')), cfg.StrOpt('auth_strategy', default='keystone', - help='Authentication strategy to use when connecting to ' - 'glance. Only "keystone" and "noauth" are currently ' - 'supported by ironic.'), + help=_('Authentication strategy to use when connecting to ' + 'glance. Only "keystone" and "noauth" are currently ' + 'supported by ironic.')), ] CONF.register_opts(glance_opts, group='glance') diff --git a/ironic/common/images.py b/ironic/common/images.py index 542fd98f5b..06a948e466 100644 --- a/ironic/common/images.py +++ b/ironic/common/images.py @@ -42,17 +42,17 @@ LOG = logging.getLogger(__name__) image_opts = [ cfg.BoolOpt('force_raw_images', default=True, - help='If True, convert backing images to "raw" disk image ' - 'format.'), + help=_('If True, convert backing images to "raw" disk image ' + 'format.')), cfg.StrOpt('isolinux_bin', default='/usr/lib/syslinux/isolinux.bin', - help='Path to isolinux binary file.'), + help=_('Path to isolinux binary file.')), cfg.StrOpt('isolinux_config_template', default=paths.basedir_def('common/isolinux_config.template'), - help='Template file for isolinux configuration file.'), + help=_('Template file for isolinux configuration file.')), cfg.StrOpt('grub_config_template', default=paths.basedir_def('common/grub_conf.template'), - help='Template file for grub configuration file.'), + help=_('Template file for grub configuration file.')), ] diff --git a/ironic/common/keystone.py b/ironic/common/keystone.py index 7defc354a6..8b3f069d47 100644 --- a/ironic/common/keystone.py +++ b/ironic/common/keystone.py @@ -23,8 +23,8 @@ CONF = cfg.CONF keystone_opts = [ cfg.StrOpt('region_name', - help='The region used for getting endpoints of OpenStack' - 'services.'), + help=_('The region used for getting endpoints of OpenStack' + 'services.')), ] CONF.register_opts(keystone_opts, group='keystone') diff --git a/ironic/common/paths.py b/ironic/common/paths.py index 838583793b..d11c3682f7 100644 --- a/ironic/common/paths.py +++ b/ironic/common/paths.py @@ -19,17 +19,20 @@ import os from oslo_config import cfg +from ironic.common.i18n import _ + path_opts = [ cfg.StrOpt('pybasedir', default=os.path.abspath(os.path.join(os.path.dirname(__file__), '../')), - help='Directory where the ironic python module is installed.'), + help=_('Directory where the ironic python module is ' + 'installed.')), cfg.StrOpt('bindir', default='$pybasedir/bin', - help='Directory where ironic binaries are installed.'), + help=_('Directory where ironic binaries are installed.')), cfg.StrOpt('state_path', default='$pybasedir', - help="Top-level directory for maintaining ironic's state."), + help=_("Top-level directory for maintaining ironic's state.")), ] CONF = cfg.CONF diff --git a/ironic/common/service.py b/ironic/common/service.py index 90cfdc8188..6d5a2706a4 100644 --- a/ironic/common/service.py +++ b/ironic/common/service.py @@ -25,6 +25,7 @@ from oslo_service import service from oslo_utils import importutils from ironic.common import config +from ironic.common.i18n import _ from ironic.common.i18n import _LE from ironic.common.i18n import _LI from ironic.common import rpc @@ -34,14 +35,14 @@ from ironic.objects import base as objects_base service_opts = [ cfg.IntOpt('periodic_interval', default=60, - help='Seconds between running periodic tasks.'), + help=_('Seconds between running periodic tasks.')), cfg.StrOpt('host', default=socket.getfqdn(), - help='Name of this node. This can be an opaque identifier. ' - 'It is not necessarily a hostname, FQDN, or IP address. ' - 'However, the node name must be valid within ' - 'an AMQP key, and if using ZeroMQ, a valid ' - 'hostname, FQDN, or IP address.'), + help=_('Name of this node. This can be an opaque identifier. ' + 'It is not necessarily a hostname, FQDN, or IP address. ' + 'However, the node name must be valid within ' + 'an AMQP key, and if using ZeroMQ, a valid ' + 'hostname, FQDN, or IP address.')), ] cfg.CONF.register_opts(service_opts) diff --git a/ironic/common/swift.py b/ironic/common/swift.py index f0316248f0..8fa2d6585a 100644 --- a/ironic/common/swift.py +++ b/ironic/common/swift.py @@ -28,8 +28,8 @@ from ironic.common import keystone swift_opts = [ cfg.IntOpt('swift_max_retries', default=2, - help='Maximum number of times to retry a Swift request, ' - 'before failing.') + help=_('Maximum number of times to retry a Swift request, ' + 'before failing.')) ] diff --git a/ironic/common/utils.py b/ironic/common/utils.py index a35318013e..67f4beaad6 100644 --- a/ironic/common/utils.py +++ b/ironic/common/utils.py @@ -43,12 +43,12 @@ from ironic.common.i18n import _LW utils_opts = [ cfg.StrOpt('rootwrap_config', default="/etc/ironic/rootwrap.conf", - help='Path to the rootwrap configuration file to use for ' - 'running commands as root.'), + help=_('Path to the rootwrap configuration file to use for ' + 'running commands as root.')), cfg.StrOpt('tempdir', default=tempfile.gettempdir(), - help='Temporary working directory, default is Python temp ' - 'dir.'), + help=_('Temporary working directory, default is Python temp ' + 'dir.')), ] CONF = cfg.CONF diff --git a/ironic/conductor/manager.py b/ironic/conductor/manager.py index 5700130a77..c3f3ac74a3 100644 --- a/ironic/conductor/manager.py +++ b/ironic/conductor/manager.py @@ -85,105 +85,105 @@ LOG = log.getLogger(__name__) conductor_opts = [ cfg.StrOpt('api_url', - help=('URL of Ironic API service. If not set ironic can ' - 'get the current value from the keystone service ' - 'catalog.')), + help=_('URL of Ironic API service. If not set ironic can ' + 'get the current value from the keystone service ' + 'catalog.')), cfg.IntOpt('heartbeat_interval', default=10, - help='Seconds between conductor heart beats.'), + help=_('Seconds between conductor heart beats.')), cfg.IntOpt('heartbeat_timeout', default=60, - help='Maximum time (in seconds) since the last check-in ' - 'of a conductor. A conductor is considered inactive ' - 'when this time has been exceeded.'), + help=_('Maximum time (in seconds) since the last check-in ' + 'of a conductor. A conductor is considered inactive ' + 'when this time has been exceeded.')), cfg.IntOpt('sync_power_state_interval', default=60, - help='Interval between syncing the node power state to the ' - 'database, in seconds.'), + help=_('Interval between syncing the node power state to the ' + 'database, in seconds.')), cfg.IntOpt('check_provision_state_interval', default=60, - help='Interval between checks of provision timeouts, ' - 'in seconds.'), + help=_('Interval between checks of provision timeouts, ' + 'in seconds.')), cfg.IntOpt('deploy_callback_timeout', default=1800, - help='Timeout (seconds) to wait for a callback from ' - 'a deploy ramdisk. Set to 0 to disable timeout.'), + help=_('Timeout (seconds) to wait for a callback from ' + 'a deploy ramdisk. Set to 0 to disable timeout.')), cfg.BoolOpt('force_power_state_during_sync', default=True, - help='During sync_power_state, should the hardware power ' - 'state be set to the state recorded in the database ' - '(True) or should the database be updated based on ' - 'the hardware state (False).'), + help=_('During sync_power_state, should the hardware power ' + 'state be set to the state recorded in the database ' + '(True) or should the database be updated based on ' + 'the hardware state (False).')), cfg.IntOpt('power_state_sync_max_retries', default=3, - help='During sync_power_state failures, limit the ' - 'number of times Ironic should try syncing the ' - 'hardware node power state with the node power state ' - 'in DB'), + help=_('During sync_power_state failures, limit the ' + 'number of times Ironic should try syncing the ' + 'hardware node power state with the node power state ' + 'in DB')), cfg.IntOpt('periodic_max_workers', default=8, - help='Maximum number of worker threads that can be started ' - 'simultaneously by a periodic task. Should be less ' - 'than RPC thread pool size.'), + help=_('Maximum number of worker threads that can be started ' + 'simultaneously by a periodic task. Should be less ' + 'than RPC thread pool size.')), cfg.IntOpt('workers_pool_size', default=100, - help='The size of the workers greenthread pool.'), + help=_('The size of the workers greenthread pool.')), cfg.IntOpt('node_locked_retry_attempts', default=3, - help='Number of attempts to grab a node lock.'), + help=_('Number of attempts to grab a node lock.')), cfg.IntOpt('node_locked_retry_interval', default=1, - help='Seconds to sleep between node lock attempts.'), + help=_('Seconds to sleep between node lock attempts.')), cfg.BoolOpt('send_sensor_data', default=False, - help='Enable sending sensor data message via the ' - 'notification bus'), + help=_('Enable sending sensor data message via the ' + 'notification bus')), cfg.IntOpt('send_sensor_data_interval', default=600, - help='Seconds between conductor sending sensor data message' - ' to ceilometer via the notification bus.'), + help=_('Seconds between conductor sending sensor data message' + ' to ceilometer via the notification bus.')), cfg.ListOpt('send_sensor_data_types', default=['ALL'], - help='List of comma separated meter types which need to be' - ' sent to Ceilometer. The default value, "ALL", is a ' - 'special value meaning send all the sensor data.'), + help=_('List of comma separated meter types which need to be' + ' sent to Ceilometer. The default value, "ALL", is a ' + 'special value meaning send all the sensor data.')), cfg.IntOpt('sync_local_state_interval', default=180, - help='When conductors join or leave the cluster, existing ' - 'conductors may need to update any persistent ' - 'local state as nodes are moved around the cluster. ' - 'This option controls how often, in seconds, each ' - 'conductor will check for nodes that it should ' - '"take over". Set it to a negative value to disable ' - 'the check entirely.'), + help=_('When conductors join or leave the cluster, existing ' + 'conductors may need to update any persistent ' + 'local state as nodes are moved around the cluster. ' + 'This option controls how often, in seconds, each ' + 'conductor will check for nodes that it should ' + '"take over". Set it to a negative value to disable ' + 'the check entirely.')), cfg.BoolOpt('configdrive_use_swift', default=False, - help='Whether to upload the config drive to Swift.'), + help=_('Whether to upload the config drive to Swift.')), cfg.StrOpt('configdrive_swift_container', default='ironic_configdrive_container', - help='Name of the Swift container to store config drive ' - 'data. Used when configdrive_use_swift is True.'), + help=_('Name of the Swift container to store config drive ' + 'data. Used when configdrive_use_swift is True.')), cfg.IntOpt('inspect_timeout', default=1800, - help='Timeout (seconds) for waiting for node inspection. ' - '0 - unlimited.'), + help=_('Timeout (seconds) for waiting for node inspection. ' + '0 - unlimited.')), cfg.BoolOpt('clean_nodes', default=True, - help='Cleaning is a configurable set of steps, such as ' - 'erasing disk drives, that are performed on the node ' - 'to ensure it is in a baseline state and ready to be ' - 'deployed to. ' - 'This is done after instance deletion, and during ' - 'the transition from a "managed" to "available" ' - 'state. When enabled, the particular steps ' - 'performed to clean a node depend on which driver ' - 'that node is managed by; see the individual ' - 'driver\'s documentation for details. ' - 'NOTE: The introduction of the cleaning operation ' - 'causes instance deletion to take significantly ' - 'longer. In an environment where all tenants are ' - 'trusted (eg, because there is only one tenant), ' - 'this option could be safely disabled.'), + help=_('Cleaning is a configurable set of steps, such as ' + 'erasing disk drives, that are performed on the node ' + 'to ensure it is in a baseline state and ready to be ' + 'deployed to. ' + 'This is done after instance deletion, and during ' + 'the transition from a "managed" to "available" ' + 'state. When enabled, the particular steps ' + 'performed to clean a node depend on which driver ' + 'that node is managed by; see the individual ' + 'driver\'s documentation for details. ' + 'NOTE: The introduction of the cleaning operation ' + 'causes instance deletion to take significantly ' + 'longer. In an environment where all tenants are ' + 'trusted (eg, because there is only one tenant), ' + 'this option could be safely disabled.')), ] CONF = cfg.CONF CONF.register_opts(conductor_opts, 'conductor') diff --git a/ironic/db/sqlalchemy/models.py b/ironic/db/sqlalchemy/models.py index 4b4ba10746..1889ad4d50 100644 --- a/ironic/db/sqlalchemy/models.py +++ b/ironic/db/sqlalchemy/models.py @@ -30,13 +30,14 @@ from sqlalchemy import schema, String, Text from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.types import TypeDecorator, TEXT +from ironic.common.i18n import _ from ironic.common import paths sql_opts = [ cfg.StrOpt('mysql_engine', default='InnoDB', - help='MySQL engine to use.') + help=_('MySQL engine to use.')) ] _DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('ironic.sqlite') diff --git a/ironic/dhcp/neutron.py b/ironic/dhcp/neutron.py index 790aca83da..16fe5813bc 100644 --- a/ironic/dhcp/neutron.py +++ b/ironic/dhcp/neutron.py @@ -35,24 +35,24 @@ from ironic.drivers.modules import ssh neutron_opts = [ cfg.StrOpt('url', default='http://$my_ip:9696', - help='URL for connecting to neutron.'), + help=_('URL for connecting to neutron.')), cfg.IntOpt('url_timeout', default=30, - help='Timeout value for connecting to neutron in seconds.'), + help=_('Timeout value for connecting to neutron in seconds.')), cfg.IntOpt('retries', default=3, - help='Client retries in the case of a failed request.'), + help=_('Client retries in the case of a failed request.')), cfg.StrOpt('auth_strategy', default='keystone', - help='Default authentication strategy to use when connecting ' - 'to neutron. Can be either "keystone" or "noauth". ' - 'Running neutron in noauth mode (related to but not ' - 'affected by this setting) is insecure and should only be ' - 'used for testing.'), + help=_('Default authentication strategy to use when connecting ' + 'to neutron. Can be either "keystone" or "noauth". ' + 'Running neutron in noauth mode (related to but not ' + 'affected by this setting) is insecure and should only ' + 'be used for testing.')), cfg.StrOpt('cleaning_network_uuid', - help='UUID of the network to create Neutron ports on when ' - 'booting to a ramdisk for cleaning/zapping using Neutron ' - 'DHCP') + help=_('UUID of the network to create Neutron ports on when ' + 'booting to a ramdisk for cleaning/zapping using ' + 'Neutron DHCP')) ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/agent.py b/ironic/drivers/modules/agent.py index 28b60417f6..a430ac51e1 100644 --- a/ironic/drivers/modules/agent.py +++ b/ironic/drivers/modules/agent.py @@ -44,30 +44,29 @@ from ironic.openstack.common import fileutils agent_opts = [ cfg.StrOpt('agent_pxe_append_params', default='nofb nomodeset vga=normal', - help='Additional append parameters for baremetal PXE boot.'), + help=_('Additional append parameters for baremetal PXE boot.')), cfg.StrOpt('agent_pxe_config_template', default=paths.basedir_def( 'drivers/modules/agent_config.template'), - help='Template file for PXE configuration.'), + help=_('Template file for PXE configuration.')), cfg.StrOpt('agent_pxe_bootfile_name', default='pxelinux.0', - help='Neutron bootfile DHCP parameter.'), + help=_('Neutron bootfile DHCP parameter.')), cfg.IntOpt('agent_erase_devices_priority', - help='Priority to run in-band erase devices via the Ironic ' - 'Python Agent ramdisk. If unset, will use the priority ' - 'set in the ramdisk (defaults to 10 for the ' - 'GenericHardwareManager). If set to 0, will not run ' - 'during cleaning.'), + help=_('Priority to run in-band erase devices via the Ironic ' + 'Python Agent ramdisk. If unset, will use the priority ' + 'set in the ramdisk (defaults to 10 for the ' + 'GenericHardwareManager). If set to 0, will not run ' + 'during cleaning.')), cfg.IntOpt('agent_erase_devices_iterations', default=1, - help='Number of iterations to be run for erasing devices.'), + help=_('Number of iterations to be run for erasing devices.')), cfg.BoolOpt('manage_tftp', default=True, - help='Whether Ironic will manage TFTP files for the deploy ' - 'ramdisks. If set to False, you will need to configure ' - 'your own TFTP server that allows booting the deploy ' - 'ramdisks.' - ), + help=_('Whether Ironic will manage TFTP files for the deploy ' + 'ramdisks. If set to False, you will need to configure ' + 'your own TFTP server that allows booting the deploy ' + 'ramdisks.')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/agent_base_vendor.py b/ironic/drivers/modules/agent_base_vendor.py index d42117a87c..9ef60f3dcd 100644 --- a/ironic/drivers/modules/agent_base_vendor.py +++ b/ironic/drivers/modules/agent_base_vendor.py @@ -43,16 +43,16 @@ from ironic import objects agent_opts = [ cfg.IntOpt('heartbeat_timeout', default=300, - help='Maximum interval (in seconds) for agent heartbeats.'), + help=_('Maximum interval (in seconds) for agent heartbeats.')), cfg.IntOpt('post_deploy_get_power_state_retries', default=6, - help='Number of times to retry getting power state to check ' - 'if bare metal node has been powered off after a soft ' - 'power off.'), + help=_('Number of times to retry getting power state to check ' + 'if bare metal node has been powered off after a soft ' + 'power off.')), cfg.IntOpt('post_deploy_get_power_state_retry_interval', default=5, - help='Amount of time (in seconds) to wait between polling ' - 'power state after trigger soft poweroff.'), + help=_('Amount of time (in seconds) to wait between polling ' + 'power state after trigger soft poweroff.')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/agent_client.py b/ironic/drivers/modules/agent_client.py index 9f550e3643..fb8b50dc51 100644 --- a/ironic/drivers/modules/agent_client.py +++ b/ironic/drivers/modules/agent_client.py @@ -23,8 +23,8 @@ from ironic.common.i18n import _ agent_opts = [ cfg.StrOpt('agent_api_version', default='v1', - help='API version to use for communicating with the ramdisk ' - 'agent.') + help=_('API version to use for communicating with the ramdisk ' + 'agent.')) ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/amt/common.py b/ironic/drivers/modules/amt/common.py index 479cb968c0..0ba7facc24 100644 --- a/ironic/drivers/modules/amt/common.py +++ b/ironic/drivers/modules/amt/common.py @@ -48,8 +48,8 @@ COMMON_PROPERTIES.update(OPTIONAL_PROPERTIES) opts = [ cfg.StrOpt('protocol', default='http', - help='Protocol used for AMT endpoint, ' - 'support http/https'), + help=_('Protocol used for AMT endpoint, ' + 'support http/https')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/amt/power.py b/ironic/drivers/modules/amt/power.py index 87c1c06e90..b0eb7af814 100644 --- a/ironic/drivers/modules/amt/power.py +++ b/ironic/drivers/modules/amt/power.py @@ -38,12 +38,12 @@ pywsman = importutils.try_import('pywsman') opts = [ cfg.IntOpt('max_attempts', default=3, - help='Maximum number of times to attempt an AMT operation, ' - 'before failing'), + help=_('Maximum number of times to attempt an AMT operation, ' + 'before failing')), cfg.IntOpt('action_wait', default=10, - help='Amount of time (in seconds) to wait, before retrying ' - 'an AMT operation') + help=_('Amount of time (in seconds) to wait, before retrying ' + 'an AMT operation')) ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/console_utils.py b/ironic/drivers/modules/console_utils.py index 3ebc08baa7..b4172a9622 100644 --- a/ironic/drivers/modules/console_utils.py +++ b/ironic/drivers/modules/console_utils.py @@ -38,21 +38,22 @@ from ironic.common import utils opts = [ cfg.StrOpt('terminal', default='shellinaboxd', - help='Path to serial console terminal program'), + help=_('Path to serial console terminal program')), cfg.StrOpt('terminal_cert_dir', - help='Directory containing the terminal SSL cert(PEM) for ' - 'serial console access'), + help=_('Directory containing the terminal SSL cert(PEM) for ' + 'serial console access')), cfg.StrOpt('terminal_pid_dir', - help='Directory for holding terminal pid files. ' - 'If not specified, the temporary directory will be used.'), + help=_('Directory for holding terminal pid files. ' + 'If not specified, the temporary directory ' + 'will be used.')), cfg.IntOpt('subprocess_checking_interval', default=1, - help='Time interval (in seconds) for checking the status of ' - 'console subprocess.'), + help=_('Time interval (in seconds) for checking the status of ' + 'console subprocess.')), cfg.IntOpt('subprocess_timeout', default=10, - help='Time (in seconds) to wait for the console subprocess ' - 'to start.'), + help=_('Time (in seconds) to wait for the console subprocess ' + 'to start.')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py index 881a30b84e..e579f7687f 100644 --- a/ironic/drivers/modules/deploy_utils.py +++ b/ironic/drivers/modules/deploy_utils.py @@ -54,15 +54,15 @@ from ironic import objects deploy_opts = [ cfg.IntOpt('efi_system_partition_size', default=200, - help='Size of EFI system partition in MiB when configuring ' - 'UEFI systems for local boot.'), + help=_('Size of EFI system partition in MiB when configuring ' + 'UEFI systems for local boot.')), cfg.StrOpt('dd_block_size', default='1M', - help='Block size to use when writing to the nodes disk.'), + help=_('Block size to use when writing to the nodes disk.')), cfg.IntOpt('iscsi_verify_attempts', default=3, - help='Maximum attempts to verify an iSCSI connection is ' - 'active, sleeping 1 second between attempts.'), + help=_('Maximum attempts to verify an iSCSI connection is ' + 'active, sleeping 1 second between attempts.')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/drac/client.py b/ironic/drivers/modules/drac/client.py index 5b8b4b9411..f6e831f6dc 100644 --- a/ironic/drivers/modules/drac/client.py +++ b/ironic/drivers/modules/drac/client.py @@ -23,6 +23,7 @@ from oslo_log import log as logging from oslo_utils import importutils from ironic.common import exception +from ironic.common.i18n import _ from ironic.common.i18n import _LW from ironic.drivers.modules.drac import common as drac_common @@ -31,14 +32,14 @@ pywsman = importutils.try_import('pywsman') opts = [ cfg.IntOpt('client_retry_count', default=5, - help='In case there is a communication failure, the DRAC ' - 'client is going to resend the request as many times as ' - 'defined in this setting.'), + help=_('In case there is a communication failure, the DRAC ' + 'client is going to resend the request as many times as ' + 'defined in this setting.')), cfg.IntOpt('client_retry_delay', default=5, - help='In case there is a communication failure, the DRAC ' - 'client is going to wait for as many seconds as defined ' - 'in this setting before resending the request.') + help=_('In case there is a communication failure, the DRAC ' + 'client is going to wait for as many seconds as defined ' + 'in this setting before resending the request.')) ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/ilo/common.py b/ironic/drivers/modules/ilo/common.py index 34da277816..6af29c3269 100644 --- a/ironic/drivers/modules/ilo/common.py +++ b/ironic/drivers/modules/ilo/common.py @@ -42,17 +42,17 @@ ADVANCED_LICENSE = 3 opts = [ cfg.IntOpt('client_timeout', default=60, - help='Timeout (in seconds) for iLO operations'), + help=_('Timeout (in seconds) for iLO operations')), cfg.IntOpt('client_port', default=443, - help='Port to be used for iLO operations'), + help=_('Port to be used for iLO operations')), cfg.StrOpt('swift_ilo_container', default='ironic_ilo_container', - help='The Swift iLO container to store data.'), + help=_('The Swift iLO container to store data.')), cfg.IntOpt('swift_object_expiry_timeout', default=900, - help='Amount of time in seconds for Swift objects to ' - 'auto-expire.'), + help=_('Amount of time in seconds for Swift objects to ' + 'auto-expire.')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/ilo/deploy.py b/ironic/drivers/modules/ilo/deploy.py index a2c6c23919..991aca9f39 100644 --- a/ironic/drivers/modules/ilo/deploy.py +++ b/ironic/drivers/modules/ilo/deploy.py @@ -50,9 +50,9 @@ CONF = cfg.CONF clean_opts = [ cfg.IntOpt('clean_priority_erase_devices', - help='Priority for erase devices clean step. If unset, ' - 'it defaults to 10. If set to 0, the step will be ' - 'disabled and will not run during cleaning.') + help=_('Priority for erase devices clean step. If unset, ' + 'it defaults to 10. If set to 0, the step will be ' + 'disabled and will not run during cleaning.')) ] REQUIRED_PROPERTIES = { diff --git a/ironic/drivers/modules/ilo/management.py b/ironic/drivers/modules/ilo/management.py index ae4a8439d2..86818275c3 100644 --- a/ironic/drivers/modules/ilo/management.py +++ b/ironic/drivers/modules/ilo/management.py @@ -47,25 +47,26 @@ MANAGEMENT_PROPERTIES.update(ilo_common.CLEAN_PROPERTIES) clean_step_opts = [ cfg.IntOpt('clean_priority_reset_ilo', default=1, - help='Priority for reset_ilo clean step.'), + help=_('Priority for reset_ilo clean step.')), cfg.IntOpt('clean_priority_reset_bios_to_default', default=10, - help='Priority for reset_bios_to_default clean step.'), + help=_('Priority for reset_bios_to_default clean step.')), cfg.IntOpt('clean_priority_reset_secure_boot_keys_to_default', default=20, - help='Priority for reset_secure_boot_keys clean step. This ' - 'step will reset the secure boot keys to manufacturing ' - ' defaults.'), + help=_('Priority for reset_secure_boot_keys clean step. This ' + 'step will reset the secure boot keys to manufacturing ' + 'defaults.')), cfg.IntOpt('clean_priority_clear_secure_boot_keys', default=0, - help='Priority for clear_secure_boot_keys clean step. This ' - 'step is not enabled by default. It can be enabled to ' - 'to clear all secure boot keys enrolled with iLO.'), + help=_('Priority for clear_secure_boot_keys clean step. This ' + 'step is not enabled by default. It can be enabled to ' + 'to clear all secure boot keys enrolled with iLO.')), cfg.IntOpt('clean_priority_reset_ilo_credential', default=30, - help='Priority for reset_ilo_credential clean step. This step ' - 'requires "ilo_change_password" parameter to be updated ' - 'in nodes\'s driver_info with the new password.'), + help=_('Priority for reset_ilo_credential clean step. This ' + 'step requires "ilo_change_password" parameter to be ' + 'updated in nodes\'s driver_info with the new ' + 'password.')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/ilo/power.py b/ironic/drivers/modules/ilo/power.py index 112922e51f..6c8d044d0e 100644 --- a/ironic/drivers/modules/ilo/power.py +++ b/ironic/drivers/modules/ilo/power.py @@ -37,11 +37,12 @@ ilo_error = importutils.try_import('proliantutils.exception') opts = [ cfg.IntOpt('power_retry', default=6, - help='Number of times a power operation needs to be retried'), + help=_('Number of times a power operation needs to be ' + 'retried')), cfg.IntOpt('power_wait', default=2, - help='Amount of time in seconds to wait in between power ' - 'operations'), + help=_('Amount of time in seconds to wait in between power ' + 'operations')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/image_cache.py b/ironic/drivers/modules/image_cache.py index e8ae13feec..418e74d0e2 100644 --- a/ironic/drivers/modules/image_cache.py +++ b/ironic/drivers/modules/image_cache.py @@ -30,6 +30,7 @@ import six from ironic.common import exception from ironic.common.glance_service import service_utils +from ironic.common.i18n import _ from ironic.common.i18n import _LI from ironic.common.i18n import _LW from ironic.common import images @@ -42,8 +43,8 @@ LOG = logging.getLogger(__name__) img_cache_opts = [ cfg.BoolOpt('parallel_image_downloads', default=False, - help='Run image downloads and raw format conversions in ' - 'parallel.'), + help=_('Run image downloads and raw format conversions in ' + 'parallel.')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/inspector.py b/ironic/drivers/modules/inspector.py index 845c75399e..ac0ee61c2d 100644 --- a/ironic/drivers/modules/inspector.py +++ b/ironic/drivers/modules/inspector.py @@ -35,16 +35,16 @@ LOG = logging.getLogger(__name__) inspector_opts = [ cfg.BoolOpt('enabled', default=False, - help='whether to enable inspection using ironic-inspector', + help=_('whether to enable inspection using ironic-inspector'), deprecated_group='discoverd'), cfg.StrOpt('service_url', - help='ironic-inspector HTTP endpoint. If this is not set, the ' - 'ironic-inspector client default (http://127.0.0.1:5050) ' - 'will be used.', + help=_('ironic-inspector HTTP endpoint. If this is not set, ' + 'the ironic-inspector client default ' + '(http://127.0.0.1:5050) will be used.'), deprecated_group='discoverd'), cfg.IntOpt('status_check_period', default=60, - help='period (in seconds) to check status of nodes ' - 'on inspection', + help=_('period (in seconds) to check status of nodes ' + 'on inspection'), deprecated_group='discoverd'), ] diff --git a/ironic/drivers/modules/ipminative.py b/ironic/drivers/modules/ipminative.py index 5a310b5f96..8844c40bf3 100644 --- a/ironic/drivers/modules/ipminative.py +++ b/ironic/drivers/modules/ipminative.py @@ -45,18 +45,18 @@ if pyghmi: opts = [ cfg.IntOpt('retry_timeout', default=60, - help='Maximum time in seconds to retry IPMI operations. There ' - 'is a tradeoff when setting this value. Setting this too ' - 'low may cause older BMCs to crash and require a hard ' - 'reset. However, setting too high can cause the sync ' - 'power state periodic task to hang when there are slow ' - 'or unresponsive BMCs.'), + help=_('Maximum time in seconds to retry IPMI operations. ' + 'There is a tradeoff when setting this value. Setting ' + 'this too low may cause older BMCs to crash and require ' + 'a hard reset. However, setting too high can cause the ' + 'sync power state periodic task to hang when there are ' + 'slow or unresponsive BMCs.')), cfg.IntOpt('min_command_interval', default=5, - help='Minimum time, in seconds, between IPMI operations ' - 'sent to a server. There is a risk with some hardware ' - 'that setting this too low may cause the BMC to crash. ' - 'Recommended setting is 5 seconds.'), + help=_('Minimum time, in seconds, between IPMI operations ' + 'sent to a server. There is a risk with some hardware ' + 'that setting this too low may cause the BMC to crash. ' + 'Recommended setting is 5 seconds.')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/irmc/common.py b/ironic/drivers/modules/irmc/common.py index 4054617574..f6ff60fbe1 100644 --- a/ironic/drivers/modules/irmc/common.py +++ b/ironic/drivers/modules/irmc/common.py @@ -27,18 +27,19 @@ scci = importutils.try_import('scciclient.irmc.scci') opts = [ cfg.IntOpt('port', default=443, - help='Port to be used for iRMC operations, either 80 or 443'), + help=_('Port to be used for iRMC operations, either 80 or ' + '443')), cfg.StrOpt('auth_method', default='basic', - help='Authentication method to be used for iRMC operations, ' + - 'either "basic" or "digest"'), + help=_('Authentication method to be used for iRMC operations, ' + 'either "basic" or "digest"')), cfg.IntOpt('client_timeout', default=60, - help='Timeout (in seconds) for iRMC operations'), + help=_('Timeout (in seconds) for iRMC operations')), cfg.StrOpt('sensor_method', default='ipmitool', - help='Sensor data retrieval method, either ' + - '"ipmitool" or "scci"'), + help=_('Sensor data retrieval method, either ' + '"ipmitool" or "scci"')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/iscsi_deploy.py b/ironic/drivers/modules/iscsi_deploy.py index efaf813a5a..3a6f80ffa8 100644 --- a/ironic/drivers/modules/iscsi_deploy.py +++ b/ironic/drivers/modules/iscsi_deploy.py @@ -45,32 +45,32 @@ LOG = logging.getLogger(__name__) pxe_opts = [ cfg.StrOpt('pxe_append_params', default='nofb nomodeset vga=normal', - help='Additional append parameters for baremetal PXE boot.'), + help=_('Additional append parameters for baremetal PXE boot.')), cfg.StrOpt('default_ephemeral_format', default='ext4', - help='Default file system format for ephemeral partition, ' - 'if one is created.'), + help=_('Default file system format for ephemeral partition, ' + 'if one is created.')), cfg.StrOpt('images_path', default='/var/lib/ironic/images/', - help='On the ironic-conductor node, directory where images are ' - 'stored on disk.'), + help=_('On the ironic-conductor node, directory where images ' + 'are stored on disk.')), cfg.StrOpt('instance_master_path', default='/var/lib/ironic/master_images', - help='On the ironic-conductor node, directory where master ' - 'instance images are stored on disk.'), + help=_('On the ironic-conductor node, directory where master ' + 'instance images are stored on disk.')), cfg.IntOpt('image_cache_size', default=20480, - help='Maximum size (in MiB) of cache for master images, ' - 'including those in use.'), + help=_('Maximum size (in MiB) of cache for master images, ' + 'including those in use.')), # 10080 here is 1 week - 60*24*7. It is entirely arbitrary in the absence # of a facility to disable the ttl entirely. cfg.IntOpt('image_cache_ttl', default=10080, - help='Maximum TTL (in minutes) for old master images in ' - 'cache.'), + help=_('Maximum TTL (in minutes) for old master images in ' + 'cache.')), cfg.StrOpt('disk_devices', default='cciss/c0d0,sda,hda,vda', - help='The disk devices to scan while doing the deploy.'), + help=_('The disk devices to scan while doing the deploy.')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/pxe.py b/ironic/drivers/modules/pxe.py index 359a418cab..2bb6578c30 100644 --- a/ironic/drivers/modules/pxe.py +++ b/ironic/drivers/modules/pxe.py @@ -50,45 +50,45 @@ pxe_opts = [ cfg.StrOpt('pxe_config_template', default=paths.basedir_def( 'drivers/modules/pxe_config.template'), - help='On ironic-conductor node, template file for PXE ' - 'configuration.'), + help=_('On ironic-conductor node, template file for PXE ' + 'configuration.')), cfg.StrOpt('uefi_pxe_config_template', default=paths.basedir_def( 'drivers/modules/elilo_efi_pxe_config.template'), - help='On ironic-conductor node, template file for PXE ' - 'configuration for UEFI boot loader.'), + help=_('On ironic-conductor node, template file for PXE ' + 'configuration for UEFI boot loader.')), cfg.StrOpt('tftp_server', default='$my_ip', - help='IP address of ironic-conductor node\'s TFTP server.'), + help=_('IP address of ironic-conductor node\'s TFTP server.')), cfg.StrOpt('tftp_root', default='/tftpboot', - help='ironic-conductor node\'s TFTP root path.'), + help=_('ironic-conductor node\'s TFTP root path.')), cfg.StrOpt('tftp_master_path', default='/tftpboot/master_images', - help='On ironic-conductor node, directory where master TFTP ' - 'images are stored on disk.'), + help=_('On ironic-conductor node, directory where master TFTP ' + 'images are stored on disk.')), # NOTE(dekehn): Additional boot files options may be created in the event # other architectures require different boot files. cfg.StrOpt('pxe_bootfile_name', default='pxelinux.0', - help='Bootfile DHCP parameter.'), + help=_('Bootfile DHCP parameter.')), cfg.StrOpt('uefi_pxe_bootfile_name', default='elilo.efi', - help='Bootfile DHCP parameter for UEFI boot mode.'), + help=_('Bootfile DHCP parameter for UEFI boot mode.')), cfg.StrOpt('http_url', - help='ironic-conductor node\'s HTTP server URL. ' - 'Example: http://192.1.2.3:8080'), + help=_('ironic-conductor node\'s HTTP server URL. ' + 'Example: http://192.1.2.3:8080')), cfg.StrOpt('http_root', default='/httpboot', - help='ironic-conductor node\'s HTTP root path.'), + help=_('ironic-conductor node\'s HTTP root path.')), cfg.BoolOpt('ipxe_enabled', default=False, - help='Enable iPXE boot.'), + help=_('Enable iPXE boot.')), cfg.StrOpt('ipxe_boot_script', default=paths.basedir_def( 'drivers/modules/boot.ipxe'), - help='On ironic-conductor node, the path to the main iPXE ' - 'script file.'), + help=_('On ironic-conductor node, the path to the main iPXE ' + 'script file.')), ] LOG = logging.getLogger(__name__) diff --git a/ironic/drivers/modules/seamicro.py b/ironic/drivers/modules/seamicro.py index 0bd4d28282..4f58d32b38 100644 --- a/ironic/drivers/modules/seamicro.py +++ b/ironic/drivers/modules/seamicro.py @@ -45,10 +45,10 @@ if seamicroclient: opts = [ cfg.IntOpt('max_retry', default=3, - help='Maximum retries for SeaMicro operations'), + help=_('Maximum retries for SeaMicro operations')), cfg.IntOpt('action_timeout', default=10, - help='Seconds to wait for power action to be completed') + help=_('Seconds to wait for power action to be completed')) ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/snmp.py b/ironic/drivers/modules/snmp.py index 820bba8fcf..1f62ff36c6 100644 --- a/ironic/drivers/modules/snmp.py +++ b/ironic/drivers/modules/snmp.py @@ -55,7 +55,7 @@ else: opts = [ cfg.IntOpt('power_timeout', default=10, - help='Seconds to wait for power action to be completed') + help=_('Seconds to wait for power action to be completed')) ] LOG = logging.getLogger(__name__) diff --git a/ironic/drivers/modules/ssh.py b/ironic/drivers/modules/ssh.py index e910af7d13..e854dd620f 100644 --- a/ironic/drivers/modules/ssh.py +++ b/ironic/drivers/modules/ssh.py @@ -46,7 +46,7 @@ from ironic.drivers import utils as driver_utils libvirt_opts = [ cfg.StrOpt('libvirt_uri', default='qemu:///system', - help='libvirt URI') + help=_('libvirt URI')) ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/ucs/power.py b/ironic/drivers/modules/ucs/power.py index 31a7c785ad..8e1ffb310c 100644 --- a/ironic/drivers/modules/ucs/power.py +++ b/ironic/drivers/modules/ucs/power.py @@ -36,11 +36,12 @@ ucs_error = importutils.try_import('UcsSdk.utils.exception') opts = [ cfg.IntOpt('max_retry', default=6, - help='Number of times a power operation needs to be retried'), + help=_('Number of times a power operation needs to be ' + 'retried')), cfg.IntOpt('action_interval', default=5, - help='Amount of time in seconds to wait in between power ' - 'operations'), + help=_('Amount of time in seconds to wait in between power ' + 'operations')), ] CONF = cfg.CONF diff --git a/ironic/drivers/modules/virtualbox.py b/ironic/drivers/modules/virtualbox.py index 5fd882f5e2..767c38cbb5 100644 --- a/ironic/drivers/modules/virtualbox.py +++ b/ironic/drivers/modules/virtualbox.py @@ -48,7 +48,7 @@ VIRTUALBOX_TO_IRONIC_POWER_MAPPING = { opts = [ cfg.IntOpt('port', default=18083, - help='Port on which VirtualBox web service is listening.'), + help=_('Port on which VirtualBox web service is listening.')), ] CONF = cfg.CONF CONF.register_opts(opts, group='virtualbox') diff --git a/ironic/netconf.py b/ironic/netconf.py index 1ad76b03f9..eaae7c8900 100644 --- a/ironic/netconf.py +++ b/ironic/netconf.py @@ -18,14 +18,16 @@ from oslo_config import cfg from oslo_utils import netutils +from ironic.common.i18n import _ + CONF = cfg.CONF netconf_opts = [ cfg.StrOpt('my_ip', default=netutils.get_my_ipv4(), - help='IP address of this host. If unset, will determine the IP ' - 'programmatically. If unable to do so, will use ' - '"127.0.0.1".'), + help=_('IP address of this host. If unset, will determine the ' + 'IP programmatically. If unable to do so, will use ' + '"127.0.0.1".')), ] CONF.register_opts(netconf_opts)