diff --git a/ironic/common/release_mappings.py b/ironic/common/release_mappings.py index 3491bfacf4..503a3b3d4f 100644 --- a/ironic/common/release_mappings.py +++ b/ironic/common/release_mappings.py @@ -12,6 +12,9 @@ # License for the specific language governing permissions and limitations # under the License. +from ironic.common.i18n import _ + + # NOTE(xek): This decides the version cap of RPC messages sent to conductor # and objects during rolling upgrades, when [DEFAULT]/pin_release_version # configuration is set. @@ -130,6 +133,9 @@ RELEASE_MAPPING['queens'] = RELEASE_MAPPING['10.1'] # List of available versions with named versions first; 'master' is excluded. RELEASE_VERSIONS = sorted(set(RELEASE_MAPPING) - {'master'}, reverse=True) +# List of available (version, description) tuples. +RELEASE_VERSIONS_DESCS = [(v, _('"%s" release') % v) for v in RELEASE_VERSIONS] + def get_object_versions(releases=None, objects=None): """Gets the supported versions for all objects. diff --git a/ironic/conf/agent.py b/ironic/conf/agent.py index 81ced891e8..3348c03419 100644 --- a/ironic/conf/agent.py +++ b/ironic/conf/agent.py @@ -58,12 +58,17 @@ opts = [ help=_('API version to use for communicating with the ramdisk ' 'agent.')), cfg.StrOpt('deploy_logs_collect', - choices=['always', 'on_failure', 'never'], + choices=[('always', _('always collect the logs')), + ('on_failure', _('only collect logs if there is a ' + 'failure')), + ('never', _('never collect logs'))], default='on_failure', help=_('Whether Ironic should collect the deployment logs on ' 'deployment failure (on_failure), always or never.')), cfg.StrOpt('deploy_logs_storage_backend', - choices=['local', 'swift'], + choices=[('local', _('store the logs locally')), + ('swift', _('store the logs in Object Storage ' + 'service'))], default='local', help=_('The name of the storage backend where the logs ' 'will be stored.')), diff --git a/ironic/conf/default.py b/ironic/conf/default.py index e1c709d39b..a1c6b87887 100644 --- a/ironic/conf/default.py +++ b/ironic/conf/default.py @@ -56,7 +56,9 @@ api_opts = [ cfg.StrOpt( 'auth_strategy', default='keystone', - choices=['noauth', 'keystone'], + choices=[('noauth', _('no authentication')), + ('keystone', _('use the Identity service for ' + 'authentication'))], help=_('Authentication strategy used by ironic-api. "noauth" should ' 'not be used in a production environment because all ' 'authentication will be disabled.')), @@ -240,7 +242,11 @@ netconf_opts = [ # default for options without set defaults that aren't required. notification_opts = [ cfg.StrOpt('notification_level', - choices=['debug', 'info', 'warning', 'error', 'critical'], + choices=[('debug', _('"debug" level')), + ('info', _('"info" level')), + ('warning', _('"warning" level')), + ('error', _('"error" level')), + ('critical', _('"critical" level'))], help=_('Specifies the minimum level for which to send ' 'notifications. If not set, no notifications will ' 'be sent. The default is for this option to be unset.')) @@ -281,7 +287,7 @@ service_opts = [ 'an AMQP key, and if using ZeroMQ, a valid ' 'hostname, FQDN, or IP address.')), cfg.StrOpt('pin_release_version', - choices=versions.RELEASE_VERSIONS, + choices=versions.RELEASE_VERSIONS_DESCS, mutable=True, help=_('Used for rolling upgrades. Setting this option ' 'downgrades (or pins) the Bare Metal API, ' diff --git a/ironic/conf/deploy.py b/ironic/conf/deploy.py index e11b075d46..6a94895fcb 100644 --- a/ironic/conf/deploy.py +++ b/ironic/conf/deploy.py @@ -66,7 +66,8 @@ opts = [ help=_('Whether to power off a node after deploy failure. ' 'Defaults to True.')), cfg.StrOpt('default_boot_option', - choices=['netboot', 'local'], + choices=[('netboot', _('boot from a network')), + ('local', _('local boot'))], help=_('Default boot option to use when no boot option is ' 'requested in node\'s driver_info. Currently the ' 'default is "netboot", but it will be changed to ' @@ -83,7 +84,8 @@ opts = [ default='swift', deprecated_group='glance', deprecated_name='temp_url_endpoint_type', - choices=['swift', 'radosgw'], + choices=[('swift', _('use Object Storage service')), + ('radosgw', _('use RADOS object store'))], help=_('Type of object store endpoint type to be ' 'used as a backend')), ] diff --git a/ironic/conf/glance.py b/ironic/conf/glance.py index 8ba3878f2e..082e2a4ac1 100644 --- a/ironic/conf/glance.py +++ b/ironic/conf/glance.py @@ -127,7 +127,9 @@ opts = [ 'glance.')), cfg.StrOpt('auth_strategy', default='keystone', - choices=['keystone', 'noauth'], + choices=[('keystone', _('use the Identity service for ' + 'authentication')), + ('noauth', _('no authentication'))], deprecated_for_removal=True, deprecated_reason=_("To configure glance in noauth mode, " "set [glance]/auth_type=none and " diff --git a/ironic/conf/ilo.py b/ironic/conf/ilo.py index 00a48d1143..884d88d17f 100644 --- a/ironic/conf/ilo.py +++ b/ironic/conf/ilo.py @@ -74,7 +74,10 @@ opts = [ help=_('CA certificate file to validate iLO.')), cfg.StrOpt('default_boot_mode', default='auto', - choices=['auto', 'bios', 'uefi'], + choices=[('auto', _('based on boot mode settings on the ' + 'system')), + ('bios', _('BIOS boot mode')), + ('uefi', _('UEFI boot mode'))], help=_('Default boot mode to be used in provisioning when ' '"boot_mode" capability is not provided in the ' '"properties/capabilities" of the node. The default is ' diff --git a/ironic/conf/irmc.py b/ironic/conf/irmc.py index ce0a0d53c5..c4f9bacd23 100644 --- a/ironic/conf/irmc.py +++ b/ironic/conf/irmc.py @@ -25,7 +25,9 @@ opts = [ help=_('IP of remote image server')), cfg.StrOpt('remote_image_share_type', default='CIFS', - choices=['CIFS', 'NFS'], + choices=[('CIFS', _('CIFS (Common Internet File System) ' + 'protocol')), + ('NFS', _('NFS (Network File System) protocol'))], ignore_case=True, help=_('Share type of virtual media')), cfg.StrOpt('remote_image_share_name', @@ -40,11 +42,13 @@ opts = [ help=_('Domain name of remote_image_user_name')), cfg.PortOpt('port', default=443, - choices=[443, 80], + choices=[(443, _('port 443')), + (80, _('port 80'))], help=_('Port to be used for iRMC operations')), cfg.StrOpt('auth_method', default='basic', - choices=['basic', 'digest'], + choices=[('basic', _('Basic authentication')), + ('digest', _('Digest authentication'))], help=_('Authentication method to be used for iRMC ' 'operations')), cfg.IntOpt('client_timeout', @@ -52,11 +56,15 @@ opts = [ help=_('Timeout (in seconds) for iRMC operations')), cfg.StrOpt('sensor_method', default='ipmitool', - choices=['ipmitool', 'scci'], + choices=[('ipmitool', _('IPMItool')), + ('scci', _('Fujitsu SCCI (ServerView Common Command ' + 'Interface)'))], help=_('Sensor data retrieval method.')), cfg.StrOpt('snmp_version', default='v2c', - choices=['v1', 'v2c', 'v3'], + choices=[('v1', _('SNMPv1')), + ('v2c', _('SNMPv2c')), + ('v3', _('SNMPv3'))], help=_('SNMP protocol version')), cfg.PortOpt('snmp_port', default=161, diff --git a/ironic/conf/neutron.py b/ironic/conf/neutron.py index c5edc6a160..567625543b 100644 --- a/ironic/conf/neutron.py +++ b/ironic/conf/neutron.py @@ -49,7 +49,9 @@ opts = [ help=_('Client retries in the case of a failed request.')), cfg.StrOpt('auth_strategy', default='keystone', - choices=['keystone', 'noauth'], + choices=[('keystone', _('use the Identity service for ' + 'authentication')), + ('noauth', _('no authentication'))], deprecated_for_removal=True, deprecated_reason=_("To configure neutron for noauth mode, " "set [neutron]/auth_type = none and " diff --git a/ironic/conf/pxe.py b/ironic/conf/pxe.py index 229d4e7eb9..a893e1509b 100644 --- a/ironic/conf/pxe.py +++ b/ironic/conf/pxe.py @@ -113,7 +113,8 @@ opts = [ 'via iPXE. Defaults to 0 (no timeout)')), cfg.StrOpt('ip_version', default='4', - choices=['4', '6'], + choices=[('4', _('IPv4')), + ('6', _('IPv6'))], help=_('The IP version that will be used for PXE booting. ' 'Defaults to 4. EXPERIMENTAL')), cfg.BoolOpt('ipxe_use_swift',