Merge "Set endpoint_override from endpoint with noauth"
This commit is contained in:
commit
9d72be5ac9
@ -278,6 +278,11 @@ class CloudRegion(object):
|
||||
value = self._get_config('endpoint_override', service_type)
|
||||
if not value:
|
||||
value = self._get_config('endpoint', service_type)
|
||||
if not value and self.config.get('auth_type') == 'none':
|
||||
# If endpoint is given and we're using the none auth type,
|
||||
# then the endpoint value is the endpoint_override for every
|
||||
# service.
|
||||
value = self.config.get('auth', {}).get('endpoint')
|
||||
return value
|
||||
|
||||
def get_connect_retries(self, service_type):
|
||||
|
@ -64,6 +64,26 @@ class TestOpenStackCloudOperatorNoAuth(base.TestCase):
|
||||
|
||||
self.assert_calls()
|
||||
|
||||
def test_ironic_noauth_auth_endpoint(self):
|
||||
"""Test noauth selection for Ironic in OpenStackCloud
|
||||
|
||||
Sometimes people also write clouds.yaml files that look like this:
|
||||
|
||||
::
|
||||
clouds:
|
||||
bifrost:
|
||||
auth_type: "none"
|
||||
endpoint: https://bare-metal.example.com
|
||||
"""
|
||||
self.cloud_noauth = openstack.connect(
|
||||
auth_type='none',
|
||||
endpoint='https://bare-metal.example.com/v1',
|
||||
)
|
||||
|
||||
self.cloud_noauth.list_machines()
|
||||
|
||||
self.assert_calls()
|
||||
|
||||
def test_ironic_noauth_admin_token_auth_type(self):
|
||||
"""Test noauth selection for Ironic in OpenStackCloud
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user