Merge "Replace default glance endpoint type"
This commit is contained in:
@@ -26,10 +26,10 @@ GLANCE_CLIENT_OPTS = [
|
|||||||
default='2',
|
default='2',
|
||||||
help='Version of Glance API to use in glanceclient.'),
|
help='Version of Glance API to use in glanceclient.'),
|
||||||
cfg.StrOpt('endpoint_type',
|
cfg.StrOpt('endpoint_type',
|
||||||
default='internalURL',
|
default='publicURL',
|
||||||
help='Type of endpoint to use in glanceclient.'
|
help='Type of endpoint to use in glanceclient.'
|
||||||
'Supported values: internalURL, publicURL, adminURL'
|
'Supported values: internalURL, publicURL, adminURL'
|
||||||
'The default is internalURL.')]
|
'The default is publicURL.')]
|
||||||
|
|
||||||
|
|
||||||
def register_opts(conf):
|
def register_opts(conf):
|
||||||
|
|||||||
@@ -167,11 +167,12 @@ class TestClients(base.TestCase):
|
|||||||
|
|
||||||
@mock.patch.object(clients.OpenStackClients, 'session')
|
@mock.patch.object(clients.OpenStackClients, 'session')
|
||||||
def test_clients_glance_diff_endpoint(self, mock_session):
|
def test_clients_glance_diff_endpoint(self, mock_session):
|
||||||
CONF.set_override('endpoint_type', 'publicURL', group='glance_client')
|
CONF.set_override('endpoint_type',
|
||||||
|
'internalURL', group='glance_client')
|
||||||
osc = clients.OpenStackClients()
|
osc = clients.OpenStackClients()
|
||||||
osc._glance = None
|
osc._glance = None
|
||||||
osc.glance()
|
osc.glance()
|
||||||
self.assertEqual('publicURL', osc.glance().http_client.interface)
|
self.assertEqual('internalURL', osc.glance().http_client.interface)
|
||||||
|
|
||||||
@mock.patch.object(clients.OpenStackClients, 'session')
|
@mock.patch.object(clients.OpenStackClients, 'session')
|
||||||
def test_clients_glance_cached(self, mock_session):
|
def test_clients_glance_cached(self, mock_session):
|
||||||
|
|||||||
Reference in New Issue
Block a user