Replace default neutron endpoint type
The default neutron endpoint type is publicURL in neutronclient. This patch replaces default neutron endpoint type from internalURL to publicURL. Change-Id: I8162b6178051df5f086488ecfb5d0bdc569ef9cd Related-Bug: #1686298
This commit is contained in:
@@ -26,10 +26,10 @@ NEUTRON_CLIENT_OPTS = [
|
|||||||
default='2.0',
|
default='2.0',
|
||||||
help='Version of Neutron API to use in neutronclient.'),
|
help='Version of Neutron API to use in neutronclient.'),
|
||||||
cfg.StrOpt('endpoint_type',
|
cfg.StrOpt('endpoint_type',
|
||||||
default='internalURL',
|
default='publicURL',
|
||||||
help='Type of endpoint to use in neutronclient.'
|
help='Type of endpoint to use in neutronclient.'
|
||||||
'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):
|
||||||
|
|||||||
@@ -329,12 +329,12 @@ class TestClients(base.TestCase):
|
|||||||
@mock.patch.object(clients.OpenStackClients, 'session')
|
@mock.patch.object(clients.OpenStackClients, 'session')
|
||||||
def test_clients_neutron_diff_endpoint(self, mock_session):
|
def test_clients_neutron_diff_endpoint(self, mock_session):
|
||||||
'''neutronclient currently only has one version (v2)'''
|
'''neutronclient currently only has one version (v2)'''
|
||||||
CONF.set_override('endpoint_type', 'publicURL',
|
CONF.set_override('endpoint_type', 'internalURL',
|
||||||
group='neutron_client')
|
group='neutron_client')
|
||||||
osc = clients.OpenStackClients()
|
osc = clients.OpenStackClients()
|
||||||
osc._neutron = None
|
osc._neutron = None
|
||||||
osc.neutron()
|
osc.neutron()
|
||||||
self.assertEqual('publicURL', osc.neutron().httpclient.interface)
|
self.assertEqual('internalURL', osc.neutron().httpclient.interface)
|
||||||
|
|
||||||
@mock.patch.object(clients.OpenStackClients, 'session')
|
@mock.patch.object(clients.OpenStackClients, 'session')
|
||||||
def test_clients_neutron_cached(self, mock_session):
|
def test_clients_neutron_cached(self, mock_session):
|
||||||
|
|||||||
Reference in New Issue
Block a user