Merge "Update default ironic endpoint type"

This commit is contained in:
Jenkins 2017-07-25 13:20:59 +00:00 committed by Gerrit Code Review
commit ea9ab8d6e5
2 changed files with 5 additions and 4 deletions

View File

@ -26,10 +26,10 @@ IRONIC_CLIENT_OPTS = [
default=1,
help='Version of Ironic API to use in ironicclient.'),
cfg.StrOpt('endpoint_type',
default='internalURL',
default='publicURL',
help='Type of endpoint to use in ironicclient.'
'Supported values: internalURL, publicURL, adminURL'
'The default is internalURL.')]
'The default is publicURL.')]
def register_opts(conf):

View File

@ -416,11 +416,12 @@ class TestClients(base.TestCase):
@mock.patch.object(clients.OpenStackClients, 'session')
def test_clients_ironic_diff_endpoint(self, mock_session):
CONF.set_override('endpoint_type', 'publicURL', group='ironic_client')
CONF.set_override('endpoint_type', 'internalURL',
group='ironic_client')
osc = clients.OpenStackClients()
osc._ironic = None
osc.ironic()
self.assertEqual('publicURL', osc.ironic().http_client.endpoint)
self.assertEqual('internalURL', osc.ironic().http_client.endpoint)
@mock.patch.object(clients.OpenStackClients, 'session')
def test_clients_ironic_cached(self, mock_session):