Merge "Replace default cinder endpoint type"

This commit is contained in:
Jenkins 2017-06-05 08:37:45 +00:00 committed by Gerrit Code Review
commit 01e865edbf
2 changed files with 5 additions and 4 deletions

View File

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

View File

@ -239,11 +239,12 @@ class TestClients(base.TestCase):
@mock.patch.object(clients.OpenStackClients, 'session')
def test_clients_cinder_diff_endpoint(self, mock_session):
CONF.set_override('endpoint_type', 'publicURL', group='cinder_client')
CONF.set_override('endpoint_type',
'internalURL', group='cinder_client')
osc = clients.OpenStackClients()
osc._cinder = None
osc.cinder()
self.assertEqual('publicURL', osc.cinder().client.interface)
self.assertEqual('internalURL', osc.cinder().client.interface)
@mock.patch.object(clients.OpenStackClients, 'session')
def test_clients_cinder_cached(self, mock_session):