Merge "Replace default glance endpoint type"

This commit is contained in:
Jenkins 2017-06-30 17:21:28 +00:00 committed by Gerrit Code Review
commit 5f179609d0
2 changed files with 5 additions and 4 deletions

View File

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

View File

@ -167,11 +167,12 @@ class TestClients(base.TestCase):
@mock.patch.object(clients.OpenStackClients, '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._glance = None
osc.glance()
self.assertEqual('publicURL', osc.glance().http_client.interface)
self.assertEqual('internalURL', osc.glance().http_client.interface)
@mock.patch.object(clients.OpenStackClients, 'session')
def test_clients_glance_cached(self, mock_session):