diff --git a/example.conf b/example.conf index 0286c2bbf..5ef73a59a 100644 --- a/example.conf +++ b/example.conf @@ -299,11 +299,11 @@ # Deprecated group/name - [DATABASE]/sql_min_pool_size #min_pool_size = 1 -# Maximum number of SQL connections to keep open in a pool. (integer -# value) +# Maximum number of SQL connections to keep open in a pool. Setting a +# value of 0 indicates no limit. (integer value) # Deprecated group/name - [DEFAULT]/sql_max_pool_size # Deprecated group/name - [DATABASE]/sql_max_pool_size -#max_pool_size = +#max_pool_size = 5 # Maximum number of database connection retries during startup. Set to # -1 to specify an infinite retry count. (integer value) @@ -325,6 +325,8 @@ # Verbosity of SQL debugging information: 0=None, 100=Everything. # (integer value) +# Minimum value: 0 +# Maximum value: 100 # Deprecated group/name - [DEFAULT]/sql_connection_debug #connection_debug = 0 @@ -594,7 +596,11 @@ # Identity API Server. (integer value) #http_request_max_retries = 3 -# Env key for the swift cache. (string value) +# Request environment key where the Swift cache object is stored. When +# auth_token middleware is deployed with a Swift cache, use this +# option to have the middleware share a caching backend with swift. +# Otherwise, use the ``memcached_servers`` option instead. (string +# value) #cache = # Required if identity server requires client certificate (string @@ -714,6 +720,18 @@ #auth_section = +[pci_devices] + +# +# From ironic_inspector.plugins.pci_devices +# + +# An alias for PCI device identified by 'vendor_id' and 'product_id' +# fields. Format: {"vendor_id": "1234", "product_id": "5678", "name": +# "pci_dev1"} (multi valued) +#alias = + + [processing] # @@ -754,7 +772,7 @@ # the Nova scheduler. Hook 'validate_interfaces' ensures that valid # NIC data was provided by the ramdisk.Do not exclude these two unless # you really know what you're doing. (string value) -#default_processing_hooks = ramdisk_error,root_disk_selection,scheduler,validate_interfaces,capabilities +#default_processing_hooks = ramdisk_error,root_disk_selection,scheduler,validate_interfaces,capabilities,pci_devices # Comma-separated list of enabled hooks for processing pipeline. The # default for this is $default_processing_hooks, hooks can be added diff --git a/ironic_inspector/common/ironic.py b/ironic_inspector/common/ironic.py index 98f02d936..dfd068713 100644 --- a/ironic_inspector/common/ironic.py +++ b/ironic_inspector/common/ironic.py @@ -34,30 +34,30 @@ IRONIC_GROUP = 'ironic' IRONIC_OPTS = [ cfg.StrOpt('os_region', - help='Keystone region used to get Ironic endpoints.'), + help=_('Keystone region used to get Ironic endpoints.')), cfg.StrOpt('os_auth_url', default='', - help='Keystone authentication endpoint for accessing Ironic ' - 'API. Use [keystone_authtoken] section for keystone ' - 'token validation.', + help=_('Keystone authentication endpoint for accessing Ironic ' + 'API. Use [keystone_authtoken] section for keystone ' + 'token validation.'), deprecated_group='discoverd', deprecated_for_removal=True, deprecated_reason='Use options presented by configured ' 'keystone auth plugin.'), cfg.StrOpt('os_username', default='', - help='User name for accessing Ironic API. ' - 'Use [keystone_authtoken] section for keystone ' - 'token validation.', + help=_('User name for accessing Ironic API. ' + 'Use [keystone_authtoken] section for keystone ' + 'token validation.'), deprecated_group='discoverd', deprecated_for_removal=True, deprecated_reason='Use options presented by configured ' 'keystone auth plugin.'), cfg.StrOpt('os_password', default='', - help='Password for accessing Ironic API. ' - 'Use [keystone_authtoken] section for keystone ' - 'token validation.', + help=_('Password for accessing Ironic API. ' + 'Use [keystone_authtoken] section for keystone ' + 'token validation.'), secret=True, deprecated_group='discoverd', deprecated_for_removal=True, @@ -65,43 +65,44 @@ IRONIC_OPTS = [ 'keystone auth plugin.'), cfg.StrOpt('os_tenant_name', default='', - help='Tenant name for accessing Ironic API. ' - 'Use [keystone_authtoken] section for keystone ' - 'token validation.', + help=_('Tenant name for accessing Ironic API. ' + 'Use [keystone_authtoken] section for keystone ' + 'token validation.'), deprecated_group='discoverd', deprecated_for_removal=True, deprecated_reason='Use options presented by configured ' 'keystone auth plugin.'), cfg.StrOpt('identity_uri', default='', - help='Keystone admin endpoint. ' - 'DEPRECATED: Use [keystone_authtoken] section for ' - 'keystone token validation.', + help=_('Keystone admin endpoint. ' + 'DEPRECATED: Use [keystone_authtoken] section for ' + 'keystone token validation.'), deprecated_group='discoverd', deprecated_for_removal=True), cfg.StrOpt('auth_strategy', default='keystone', choices=('keystone', 'noauth'), - help='Method to use for authentication: noauth or keystone.'), + help=_('Method to use for authentication: noauth or ' + 'keystone.')), cfg.StrOpt('ironic_url', default='http://localhost:6385/', - help='Ironic API URL, used to set Ironic API URL when ' - 'auth_strategy option is noauth to work with standalone ' - 'Ironic without keystone.'), + help=_('Ironic API URL, used to set Ironic API URL when ' + 'auth_strategy option is noauth to work with standalone ' + 'Ironic without keystone.')), cfg.StrOpt('os_service_type', default='baremetal', - help='Ironic service type.'), + help=_('Ironic service type.')), cfg.StrOpt('os_endpoint_type', default='internalURL', - help='Ironic endpoint type.'), + help=_('Ironic endpoint type.')), cfg.IntOpt('retry_interval', default=2, - help='Interval between retries in case of conflict error ' - '(HTTP 409).'), + help=_('Interval between retries in case of conflict error ' + '(HTTP 409).')), cfg.IntOpt('max_retries', default=30, - help='Maximum number of retries in case of conflict error ' - '(HTTP 409).'), + help=_('Maximum number of retries in case of conflict error ' + '(HTTP 409).')), ] diff --git a/ironic_inspector/common/swift.py b/ironic_inspector/common/swift.py index 2b3bd6b3c..c804cbfeb 100644 --- a/ironic_inspector/common/swift.py +++ b/ironic_inspector/common/swift.py @@ -31,35 +31,37 @@ SWIFT_GROUP = 'swift' SWIFT_OPTS = [ cfg.IntOpt('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.')), cfg.IntOpt('delete_after', default=0, - help='Number of seconds that the Swift object will last before ' - 'being deleted. (set to 0 to never delete the object).'), + help=_('Number of seconds that the Swift object will last ' + 'before being deleted. (set to 0 to never delete the ' + 'object).')), cfg.StrOpt('container', default='ironic-inspector', - help='Default Swift container to use when creating objects.'), + help=_('Default Swift container to use when creating ' + 'objects.')), cfg.StrOpt('os_auth_version', default='2', - help='Keystone authentication API version', + help=_('Keystone authentication API version'), deprecated_for_removal=True, deprecated_reason='Use options presented by configured ' 'keystone auth plugin.'), cfg.StrOpt('os_auth_url', default='', - help='Keystone authentication URL', + help=_('Keystone authentication URL'), deprecated_for_removal=True, deprecated_reason='Use options presented by configured ' 'keystone auth plugin.'), cfg.StrOpt('os_service_type', default='object-store', - help='Swift service type.'), + help=_('Swift service type.')), cfg.StrOpt('os_endpoint_type', default='internalURL', - help='Swift endpoint type.'), + help=_('Swift endpoint type.')), cfg.StrOpt('os_region', - help='Keystone region to get endpoint for.'), + help=_('Keystone region to get endpoint for.')), ] # NOTE(pas-ha) these old options conflict with options exported by @@ -68,14 +70,14 @@ SWIFT_OPTS = [ LEGACY_OPTS = [ cfg.StrOpt('username', default='', - help='User name for accessing Swift API.'), + help=_('User name for accessing Swift API.')), cfg.StrOpt('password', default='', - help='Password for accessing Swift API.', + help=_('Password for accessing Swift API.'), secret=True), cfg.StrOpt('tenant_name', default='', - help='Tenant name for accessing Swift API.'), + help=_('Tenant name for accessing Swift API.')), ] CONF.register_opts(SWIFT_OPTS, group=SWIFT_GROUP) diff --git a/ironic_inspector/conf.py b/ironic_inspector/conf.py index 53ce106e6..a2b602ccb 100644 --- a/ironic_inspector/conf.py +++ b/ironic_inspector/conf.py @@ -14,6 +14,8 @@ from oslo_config import cfg from oslo_middleware import cors +from ironic_inspector.common.i18n import _ + MIN_VERSION_HEADER = 'X-OpenStack-Ironic-Inspector-API-Minimum-Version' MAX_VERSION_HEADER = 'X-OpenStack-Ironic-Inspector-API-Maximum-Version' @@ -27,194 +29,195 @@ VALID_STORE_DATA_VALUES = ('none', 'swift') FIREWALL_OPTS = [ cfg.BoolOpt('manage_firewall', default=True, - help='Whether to manage firewall rules for PXE port.', + help=_('Whether to manage firewall rules for PXE port.'), deprecated_group='discoverd'), cfg.StrOpt('dnsmasq_interface', default='br-ctlplane', - help='Interface on which dnsmasq listens, the default is for ' - 'VM\'s.', + help=_('Interface on which dnsmasq listens, the default is for ' + 'VM\'s.'), deprecated_group='discoverd'), cfg.IntOpt('firewall_update_period', default=15, - help='Amount of time in seconds, after which repeat periodic ' - 'update of firewall.', + help=_('Amount of time in seconds, after which repeat periodic ' + 'update of firewall.'), deprecated_group='discoverd'), cfg.StrOpt('firewall_chain', default='ironic-inspector', - help='iptables chain name to use.'), + help=_('iptables chain name to use.')), ] PROCESSING_OPTS = [ cfg.StrOpt('add_ports', default='pxe', - help='Which MAC addresses to add as ports during ' - 'introspection. Possible values: ' - 'all (all MAC addresses), active (MAC addresses of NIC with IP ' - 'addresses), pxe (only MAC address of NIC node PXE booted ' - 'from, falls back to "active" if PXE MAC is not supplied ' - 'by the ramdisk).', + help=_('Which MAC addresses to add as ports during ' + 'introspection. Possible values: all ' + '(all MAC addresses), active (MAC addresses of NIC with ' + 'IP addresses), pxe (only MAC address of NIC node PXE ' + 'booted from, falls back to "active" if PXE MAC is not ' + 'supplied by the ramdisk).'), choices=VALID_ADD_PORTS_VALUES, deprecated_group='discoverd'), cfg.StrOpt('keep_ports', default='all', - help='Which ports (already present on a node) to keep after ' - 'introspection. Possible values: ' - 'all (do not delete anything), present (keep ports which MACs ' - 'were present in introspection data), added (keep only MACs ' - 'that we added during introspection).', + help=_('Which ports (already present on a node) to keep after ' + 'introspection. Possible values: all (do not delete ' + 'anything), present (keep ports which MACs were present ' + 'in introspection data), added (keep only MACs that we ' + 'added during introspection).'), choices=VALID_KEEP_PORTS_VALUES, deprecated_group='discoverd'), cfg.BoolOpt('overwrite_existing', default=True, - help='Whether to overwrite existing values in node database. ' - 'Disable this option to make introspection a ' - 'non-destructive operation.', + help=_('Whether to overwrite existing values in node ' + 'database. Disable this option to make ' + 'introspection a non-destructive operation.'), deprecated_group='discoverd'), cfg.BoolOpt('enable_setting_ipmi_credentials', default=False, - help='Whether to enable setting IPMI credentials during ' - 'introspection. This is an experimental and not well ' - 'tested feature, use at your own risk.', + help=_('Whether to enable setting IPMI credentials during ' + 'introspection. This is an experimental and not well ' + 'tested feature, use at your own risk.'), deprecated_group='discoverd'), cfg.StrOpt('default_processing_hooks', default='ramdisk_error,root_disk_selection,scheduler,' 'validate_interfaces,capabilities,pci_devices', - help='Comma-separated list of default hooks for processing ' - 'pipeline. Hook \'scheduler\' updates the node with the ' - 'minimum properties required by the Nova scheduler. ' - 'Hook \'validate_interfaces\' ensures that valid NIC ' - 'data was provided by the ramdisk.' - 'Do not exclude these two unless you really know what ' - 'you\'re doing.'), + help=_('Comma-separated list of default hooks for processing ' + 'pipeline. Hook \'scheduler\' updates the node with the ' + 'minimum properties required by the Nova scheduler. ' + 'Hook \'validate_interfaces\' ensures that valid NIC ' + 'data was provided by the ramdisk.' + 'Do not exclude these two unless you really know what ' + 'you\'re doing.')), cfg.StrOpt('processing_hooks', default='$default_processing_hooks', - help='Comma-separated list of enabled hooks for processing ' - 'pipeline. The default for this is ' - '$default_processing_hooks, hooks can be added before ' - 'or after the defaults like this: ' - '"prehook,$default_processing_hooks,posthook".', + help=_('Comma-separated list of enabled hooks for processing ' + 'pipeline. The default for this is ' + '$default_processing_hooks, hooks can be added before ' + 'or after the defaults like this: ' + '"prehook,$default_processing_hooks,posthook".'), deprecated_group='discoverd'), cfg.StrOpt('ramdisk_logs_dir', - help='If set, logs from ramdisk will be stored in this ' - 'directory.', + help=_('If set, logs from ramdisk will be stored in this ' + 'directory.'), deprecated_group='discoverd'), cfg.BoolOpt('always_store_ramdisk_logs', default=False, - help='Whether to store ramdisk logs even if it did not return ' - 'an error message (dependent upon "ramdisk_logs_dir" option ' - 'being set).', + help=_('Whether to store ramdisk logs even if it did not ' + 'return an error message (dependent upon ' + '"ramdisk_logs_dir" option being set).'), deprecated_group='discoverd'), cfg.StrOpt('node_not_found_hook', default=None, - help='The name of the hook to run when inspector receives ' - 'inspection information from a node it isn\'t already ' - 'aware of. This hook is ignored by default.'), + help=_('The name of the hook to run when inspector receives ' + 'inspection information from a node it isn\'t already ' + 'aware of. This hook is ignored by default.')), cfg.StrOpt('store_data', default='none', choices=VALID_STORE_DATA_VALUES, - help='Method for storing introspection data. If set to \'none' - '\', introspection data will not be stored.'), + help=_('Method for storing introspection data. If set to \'none' + '\', introspection data will not be stored.')), cfg.StrOpt('store_data_location', default=None, - help='Name of the key to store the location of stored data in ' - 'the extra column of the Ironic database.'), + help=_('Name of the key to store the location of stored data ' + 'in the extra column of the Ironic database.')), cfg.BoolOpt('disk_partitioning_spacing', default=True, - help='Whether to leave 1 GiB of disk size untouched for ' - 'partitioning. Only has effect when used with the IPA ' - 'as a ramdisk, for older ramdisk local_gb is ' - 'calculated on the ramdisk side.'), + help=_('Whether to leave 1 GiB of disk size untouched for ' + 'partitioning. Only has effect when used with the IPA ' + 'as a ramdisk, for older ramdisk local_gb is ' + 'calculated on the ramdisk side.')), cfg.BoolOpt('log_bmc_address', default=True, - help='Whether to log node BMC address with every message ' - 'during processing.'), + help=_('Whether to log node BMC address with every message ' + 'during processing.')), cfg.StrOpt('ramdisk_logs_filename_format', default='{uuid}_{dt:%Y%m%d-%H%M%S.%f}.tar.gz', - help='File name template for storing ramdisk logs. The ' - 'following replacements can be used: ' - '{uuid} - node UUID or "unknown", ' - '{bmc} - node BMC address or "unknown", ' - '{dt} - current UTC date and time, ' - '{mac} - PXE booting MAC or "unknown".'), + help=_('File name template for storing ramdisk logs. The ' + 'following replacements can be used: ' + '{uuid} - node UUID or "unknown", ' + '{bmc} - node BMC address or "unknown", ' + '{dt} - current UTC date and time, ' + '{mac} - PXE booting MAC or "unknown".')), cfg.BoolOpt('power_off', default=True, - help='Whether to power off a node after introspection.'), + help=_('Whether to power off a node after introspection.')), ] DISCOVERD_OPTS = [ cfg.StrOpt('database', default='', - help='SQLite3 database to store nodes under introspection, ' - 'required. Do not use :memory: here, it won\'t work. ' - 'DEPRECATED: use [database]/connection.', + help=_('SQLite3 database to store nodes under introspection, ' + 'required. Do not use :memory: here, it won\'t work. ' + 'DEPRECATED: use [database]/connection.'), deprecated_for_removal=True), ] SERVICE_OPTS = [ cfg.StrOpt('listen_address', default='0.0.0.0', - help='IP to listen on.', + help=_('IP to listen on.'), deprecated_group='discoverd'), cfg.PortOpt('listen_port', default=5050, - help='Port to listen on.', + help=_('Port to listen on.'), deprecated_group='discoverd'), cfg.StrOpt('auth_strategy', default='keystone', choices=('keystone', 'noauth'), - help='Authentication method used on the ironic-inspector ' - 'API. Either "noauth" or "keystone" are currently valid ' - 'options. "noauth" will disable all authentication.'), + help=_('Authentication method used on the ironic-inspector ' + 'API. Either "noauth" or "keystone" are currently valid ' + 'options. "noauth" will disable all authentication.')), cfg.BoolOpt('authenticate', default=None, - help='DEPRECATED: use auth_strategy.', + help=_('DEPRECATED: use auth_strategy.'), deprecated_group='discoverd', deprecated_for_removal=True), cfg.IntOpt('timeout', default=3600, - help='Timeout after which introspection is considered failed, ' - 'set to 0 to disable.', + help=_('Timeout after which introspection is considered ' + 'failed, set to 0 to disable.'), deprecated_group='discoverd'), cfg.IntOpt('node_status_keep_time', default=604800, - help='For how much time (in seconds) to keep status ' - 'information about nodes after introspection was ' - 'finished for them. Default value is 1 week.', + help=_('For how much time (in seconds) to keep status ' + 'information about nodes after introspection was ' + 'finished for them. Default value is 1 week.'), deprecated_group='discoverd'), cfg.IntOpt('clean_up_period', default=60, - help='Amount of time in seconds, after which repeat clean up ' - 'of timed out nodes and old nodes status information.', + help=_('Amount of time in seconds, after which repeat clean up ' + 'of timed out nodes and old nodes status information.'), deprecated_group='discoverd'), cfg.BoolOpt('use_ssl', default=False, - help='SSL Enabled/Disabled'), + help=_('SSL Enabled/Disabled')), cfg.StrOpt('ssl_cert_path', default='', - help='Path to SSL certificate'), + help=_('Path to SSL certificate')), cfg.StrOpt('ssl_key_path', default='', - help='Path to SSL key'), + help=_('Path to SSL key')), cfg.IntOpt('max_concurrency', default=1000, min=2, - help='The green thread pool size.'), + help=_('The green thread pool size.')), cfg.IntOpt('introspection_delay', default=5, - help='Delay (in seconds) between two introspections.'), + help=_('Delay (in seconds) between two introspections.')), cfg.StrOpt('introspection_delay_drivers', default='^.*_ssh$', - help='Only node with drivers matching this regular expression ' - 'will be affected by introspection_delay setting.'), + help=_('Only node with drivers matching this regular ' + 'expression will be affected by introspection_delay ' + 'setting.')), cfg.ListOpt('ipmi_address_fields', default=['ilo_address', 'drac_host', 'cimc_address'], - help='Ironic driver_info fields that are equivalent ' - 'to ipmi_address.'), + help=_('Ironic driver_info fields that are equivalent ' + 'to ipmi_address.')), cfg.StrOpt('rootwrap_config', default="/etc/ironic-inspector/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')), ] diff --git a/ironic_inspector/plugins/capabilities.py b/ironic_inspector/plugins/capabilities.py index dc9d5b3b6..a32fcee65 100644 --- a/ironic_inspector/plugins/capabilities.py +++ b/ironic_inspector/plugins/capabilities.py @@ -15,7 +15,7 @@ from oslo_config import cfg -from ironic_inspector.common.i18n import _LI, _LW +from ironic_inspector.common.i18n import _, _LI, _LW from ironic_inspector.plugins import base from ironic_inspector import utils @@ -32,11 +32,11 @@ DEFAULT_CPU_FLAGS_MAPPING = { CAPABILITIES_OPTS = [ cfg.BoolOpt('boot_mode', default=False, - help='Whether to store the boot mode (BIOS or UEFI).'), + help=_('Whether to store the boot mode (BIOS or UEFI).')), cfg.DictOpt('cpu_flags', default=DEFAULT_CPU_FLAGS_MAPPING, - help='Mapping between a CPU flag and a capability to set ' - 'if this flag is present.'), + help=_('Mapping between a CPU flag and a capability to set ' + 'if this flag is present.')), ] diff --git a/ironic_inspector/plugins/discovery.py b/ironic_inspector/plugins/discovery.py index 2ea441b0a..067ddc629 100644 --- a/ironic_inspector/plugins/discovery.py +++ b/ironic_inspector/plugins/discovery.py @@ -24,8 +24,8 @@ from ironic_inspector import utils DISCOVERY_OPTS = [ cfg.StrOpt('enroll_node_driver', default='fake', - help='The name of the Ironic driver used by the enroll ' - 'hook when creating a new node in Ironic.'), + help=_('The name of the Ironic driver used by the enroll ' + 'hook when creating a new node in Ironic.')), ] diff --git a/ironic_inspector/plugins/pci_devices.py b/ironic_inspector/plugins/pci_devices.py index 771967b79..0cdf00a7d 100644 --- a/ironic_inspector/plugins/pci_devices.py +++ b/ironic_inspector/plugins/pci_devices.py @@ -18,17 +18,17 @@ import json from oslo_config import cfg -from ironic_inspector.common.i18n import _LI, _LW, _LE +from ironic_inspector.common.i18n import _, _LI, _LW, _LE from ironic_inspector.plugins import base from ironic_inspector import utils PCI_DEVICES_OPTS = [ cfg.MultiStrOpt('alias', default=[], - help='An alias for PCI device identified by \'vendor_id\' ' - 'and \'product_id\' fields. Format: ' - '{"vendor_id": "1234", "product_id": "5678", "name": ' - '"pci_dev1"}'), + help=_('An alias for PCI device identified by ' + '\'vendor_id\' and \'product_id\' fields. Format: ' + '{"vendor_id": "1234", "product_id": "5678", ' + '"name": "pci_dev1"}')), ]