Merge "Make endpoint type configurable"
This commit is contained in:
commit
7bef0f63c6
|
@ -254,6 +254,12 @@
|
||||||
# value)
|
# value)
|
||||||
#ironic_url = http://localhost:6385/
|
#ironic_url = http://localhost:6385/
|
||||||
|
|
||||||
|
# Ironic service type. (string value)
|
||||||
|
#os_service_type = baremetal
|
||||||
|
|
||||||
|
# Ironic endpoint type. (string value)
|
||||||
|
#os_endpoint_type = internalURL
|
||||||
|
|
||||||
|
|
||||||
[keystone_authtoken]
|
[keystone_authtoken]
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,12 @@ IRONIC_OPTS = [
|
||||||
help='Ironic API URL, used to set Ironic API URL when '
|
help='Ironic API URL, used to set Ironic API URL when '
|
||||||
'auth_strategy option is noauth to work with standalone '
|
'auth_strategy option is noauth to work with standalone '
|
||||||
'Ironic without keystone.'),
|
'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.'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -64,13 +64,15 @@ def get_client(): # pragma: no cover
|
||||||
"""Get Ironic client instance."""
|
"""Get Ironic client instance."""
|
||||||
# NOTE: To support standalone ironic without keystone
|
# NOTE: To support standalone ironic without keystone
|
||||||
if CONF.ironic.auth_strategy == 'noauth':
|
if CONF.ironic.auth_strategy == 'noauth':
|
||||||
args = dict({'os_auth_token': 'noauth',
|
args = {'os_auth_token': 'noauth',
|
||||||
'ironic_url': CONF.ironic.ironic_url})
|
'ironic_url': CONF.ironic.ironic_url}
|
||||||
else:
|
else:
|
||||||
args = dict({'os_password': CONF.ironic.os_password,
|
args = {'os_password': CONF.ironic.os_password,
|
||||||
'os_username': CONF.ironic.os_username,
|
'os_username': CONF.ironic.os_username,
|
||||||
'os_auth_url': CONF.ironic.os_auth_url,
|
'os_auth_url': CONF.ironic.os_auth_url,
|
||||||
'os_tenant_name': CONF.ironic.os_tenant_name})
|
'os_tenant_name': CONF.ironic.os_tenant_name,
|
||||||
|
'os_service_type': CONF.ironic.os_service_type,
|
||||||
|
'os_endpoint_type': CONF.ironic.os_endpoint_type}
|
||||||
return client.get_client(1, **args)
|
return client.get_client(1, **args)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue