Merge "Move ironic options to common/ironic"

This commit is contained in:
Jenkins 2016-03-07 18:34:06 +00:00 committed by Gerrit Code Review
commit 2c88f06560
5 changed files with 69 additions and 61 deletions

View File

@ -1,6 +1,7 @@
[DEFAULT] [DEFAULT]
output_file = example.conf output_file = example.conf
namespace = ironic_inspector namespace = ironic_inspector
namespace = ironic_inspector.common.ironic
namespace = ironic_inspector.common.swift namespace = ironic_inspector.common.swift
namespace = ironic_inspector.plugins.discovery namespace = ironic_inspector.plugins.discovery
namespace = keystonemiddleware.auth_token namespace = keystonemiddleware.auth_token

View File

@ -324,7 +324,7 @@
[ironic] [ironic]
# #
# From ironic_inspector # From ironic_inspector.common.ironic
# #
# Keystone authentication endpoint for accessing Ironic API. Use # Keystone authentication endpoint for accessing Ironic API. Use

View File

@ -29,6 +29,68 @@ SET_CREDENTIALS_VALID_STATES = {'enroll'}
# 1.11 is API version, which support 'enroll' state # 1.11 is API version, which support 'enroll' state
DEFAULT_IRONIC_API_VERSION = '1.11' DEFAULT_IRONIC_API_VERSION = '1.11'
IRONIC_GROUP = 'ironic'
IRONIC_OPTS = [
cfg.StrOpt('os_auth_url',
default='',
help='Keystone authentication endpoint for accessing Ironic '
'API. Use [keystone_authtoken]/auth_uri for keystone '
'authentication.',
deprecated_group='discoverd'),
cfg.StrOpt('os_username',
default='',
help='User name for accessing Ironic API. '
'Use [keystone_authtoken]/admin_user for keystone '
'authentication.',
deprecated_group='discoverd'),
cfg.StrOpt('os_password',
default='',
help='Password for accessing Ironic API. '
'Use [keystone_authtoken]/admin_password for keystone '
'authentication.',
secret=True,
deprecated_group='discoverd'),
cfg.StrOpt('os_tenant_name',
default='',
help='Tenant name for accessing Ironic API. '
'Use [keystone_authtoken]/admin_tenant_name for keystone '
'authentication.',
deprecated_group='discoverd'),
cfg.StrOpt('identity_uri',
default='',
help='Keystone admin endpoint. '
'DEPRECATED: use [keystone_authtoken]/identity_uri.',
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.'),
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.'),
cfg.StrOpt('os_service_type',
default='baremetal',
help='Ironic service type.'),
cfg.StrOpt('os_endpoint_type',
default='internalURL',
help='Ironic endpoint type.'),
cfg.IntOpt('retry_interval',
default=2,
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).'),
]
CONF.register_opts(IRONIC_OPTS, group=IRONIC_GROUP)
def get_ipmi_address(node): def get_ipmi_address(node):
ipmi_fields = ['ipmi_address'] + CONF.ipmi_address_fields ipmi_fields = ['ipmi_address'] + CONF.ipmi_address_fields
@ -108,3 +170,7 @@ def dict_to_capabilities(caps_dict):
return ','.join(["%s:%s" % (key, value) return ','.join(["%s:%s" % (key, value)
for key, value in caps_dict.items() for key, value in caps_dict.items()
if value is not None]) if value is not None])
def list_opts():
return [(IRONIC_GROUP, IRONIC_OPTS)]

View File

@ -19,64 +19,6 @@ VALID_KEEP_PORTS_VALUES = ('all', 'present', 'added')
VALID_STORE_DATA_VALUES = ('none', 'swift') VALID_STORE_DATA_VALUES = ('none', 'swift')
IRONIC_OPTS = [
cfg.StrOpt('os_auth_url',
default='',
help='Keystone authentication endpoint for accessing Ironic '
'API. Use [keystone_authtoken]/auth_uri for keystone '
'authentication.',
deprecated_group='discoverd'),
cfg.StrOpt('os_username',
default='',
help='User name for accessing Ironic API. '
'Use [keystone_authtoken]/admin_user for keystone '
'authentication.',
deprecated_group='discoverd'),
cfg.StrOpt('os_password',
default='',
help='Password for accessing Ironic API. '
'Use [keystone_authtoken]/admin_password for keystone '
'authentication.',
secret=True,
deprecated_group='discoverd'),
cfg.StrOpt('os_tenant_name',
default='',
help='Tenant name for accessing Ironic API. '
'Use [keystone_authtoken]/admin_tenant_name for keystone '
'authentication.',
deprecated_group='discoverd'),
cfg.StrOpt('identity_uri',
default='',
help='Keystone admin endpoint. '
'DEPRECATED: use [keystone_authtoken]/identity_uri.',
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.'),
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.'),
cfg.StrOpt('os_service_type',
default='baremetal',
help='Ironic service type.'),
cfg.StrOpt('os_endpoint_type',
default='internalURL',
help='Ironic endpoint type.'),
cfg.IntOpt('retry_interval',
default=2,
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).'),
]
FIREWALL_OPTS = [ FIREWALL_OPTS = [
cfg.BoolOpt('manage_firewall', cfg.BoolOpt('manage_firewall',
default=True, default=True,
@ -263,7 +205,6 @@ SERVICE_OPTS = [
cfg.CONF.register_opts(SERVICE_OPTS) cfg.CONF.register_opts(SERVICE_OPTS)
cfg.CONF.register_opts(FIREWALL_OPTS, group='firewall') cfg.CONF.register_opts(FIREWALL_OPTS, group='firewall')
cfg.CONF.register_opts(PROCESSING_OPTS, group='processing') cfg.CONF.register_opts(PROCESSING_OPTS, group='processing')
cfg.CONF.register_opts(IRONIC_OPTS, group='ironic')
cfg.CONF.register_opts(DISCOVERD_OPTS, group='discoverd') cfg.CONF.register_opts(DISCOVERD_OPTS, group='discoverd')
@ -271,7 +212,6 @@ def list_opts():
return [ return [
('', SERVICE_OPTS), ('', SERVICE_OPTS),
('firewall', FIREWALL_OPTS), ('firewall', FIREWALL_OPTS),
('ironic', IRONIC_OPTS),
('processing', PROCESSING_OPTS), ('processing', PROCESSING_OPTS),
('discoverd', DISCOVERD_OPTS), ('discoverd', DISCOVERD_OPTS),
] ]

View File

@ -55,6 +55,7 @@ ironic_inspector.rules.actions =
extend-attribute = ironic_inspector.plugins.rules:ExtendAttributeAction extend-attribute = ironic_inspector.plugins.rules:ExtendAttributeAction
oslo.config.opts = oslo.config.opts =
ironic_inspector = ironic_inspector.conf:list_opts ironic_inspector = ironic_inspector.conf:list_opts
ironic_inspector.common.ironic = ironic_inspector.common.ironic:list_opts
ironic_inspector.common.swift = ironic_inspector.common.swift:list_opts ironic_inspector.common.swift = ironic_inspector.common.swift:list_opts
ironic_inspector.plugins.discovery = ironic_inspector.plugins.discovery:list_opts ironic_inspector.plugins.discovery = ironic_inspector.plugins.discovery:list_opts