Merge "Replace default cinder endpoint type"
This commit is contained in:
commit
01e865edbf
@ -26,10 +26,10 @@ CINDER_CLIENT_OPTS = [
|
|||||||
default='3',
|
default='3',
|
||||||
help='Version of Cinder API to use in cinderclient.'),
|
help='Version of Cinder API to use in cinderclient.'),
|
||||||
cfg.StrOpt('endpoint_type',
|
cfg.StrOpt('endpoint_type',
|
||||||
default='internalURL',
|
default='publicURL',
|
||||||
help='Type of endpoint to use in cinderclient.'
|
help='Type of endpoint to use in cinderclient.'
|
||||||
'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):
|
||||||
|
@ -239,11 +239,12 @@ class TestClients(base.TestCase):
|
|||||||
|
|
||||||
@mock.patch.object(clients.OpenStackClients, 'session')
|
@mock.patch.object(clients.OpenStackClients, 'session')
|
||||||
def test_clients_cinder_diff_endpoint(self, mock_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 = clients.OpenStackClients()
|
||||||
osc._cinder = None
|
osc._cinder = None
|
||||||
osc.cinder()
|
osc.cinder()
|
||||||
self.assertEqual('publicURL', osc.cinder().client.interface)
|
self.assertEqual('internalURL', osc.cinder().client.interface)
|
||||||
|
|
||||||
@mock.patch.object(clients.OpenStackClients, 'session')
|
@mock.patch.object(clients.OpenStackClients, 'session')
|
||||||
def test_clients_cinder_cached(self, mock_session):
|
def test_clients_cinder_cached(self, mock_session):
|
||||||
|
Loading…
Reference in New Issue
Block a user