Merge "Adding version for neutronclient"
This commit is contained in:
commit
a503a82464
@ -50,7 +50,7 @@ neutron_opts = [
|
|||||||
keystone_opts = [
|
keystone_opts = [
|
||||||
cfg.StrOpt('auth_uri',
|
cfg.StrOpt('auth_uri',
|
||||||
default=os.environ.get('IDENTITY_URL',
|
default=os.environ.get('IDENTITY_URL',
|
||||||
'http://127.0.0.1:35357'),
|
'http://127.0.0.1:35357/v2.0'),
|
||||||
help=_('The URL for accessing the identity service.')),
|
help=_('The URL for accessing the identity service.')),
|
||||||
cfg.StrOpt('admin_user',
|
cfg.StrOpt('admin_user',
|
||||||
default=os.environ.get('SERVICE_USER'),
|
default=os.environ.get('SERVICE_USER'),
|
||||||
|
@ -53,7 +53,7 @@ def neutron_client():
|
|||||||
password=password, auth_url=auth_uri)
|
password=password, auth_url=auth_uri)
|
||||||
else:
|
else:
|
||||||
app.neutron = utils.get_neutron_client_simple(
|
app.neutron = utils.get_neutron_client_simple(
|
||||||
url=neutron_uri, token=auth_token)
|
url=neutron_uri, auth_url=auth_uri, token=auth_token)
|
||||||
|
|
||||||
app.enable_dhcp = cfg.CONF.neutron_client.enable_dhcp
|
app.enable_dhcp = cfg.CONF.neutron_client.enable_dhcp
|
||||||
app.neutron.format = 'json'
|
app.neutron.format = 'json'
|
||||||
|
@ -35,7 +35,7 @@ class ConfigurationTest(base.TestKuryrBase):
|
|||||||
self.assertEqual('http://127.0.0.1:9696',
|
self.assertEqual('http://127.0.0.1:9696',
|
||||||
config.CONF.neutron_client.neutron_uri)
|
config.CONF.neutron_client.neutron_uri)
|
||||||
|
|
||||||
self.assertEqual('http://127.0.0.1:35357',
|
self.assertEqual('http://127.0.0.1:35357/v2.0',
|
||||||
config.CONF.keystone_client.auth_uri)
|
config.CONF.keystone_client.auth_uri)
|
||||||
|
|
||||||
def test_check_for_neutron_ext_support_with_ex(self):
|
def test_check_for_neutron_ext_support_with_ex(self):
|
||||||
|
@ -29,8 +29,10 @@ DOCKER_NETNS_BASE = '/var/run/docker/netns'
|
|||||||
PORT_POSTFIX = 'port'
|
PORT_POSTFIX = 'port'
|
||||||
|
|
||||||
|
|
||||||
def get_neutron_client_simple(url, token):
|
def get_neutron_client_simple(url, auth_url, token):
|
||||||
return client.Client('2.0', endpoint_url=url, token=token)
|
auths = auth_url.rsplit('/', 1)
|
||||||
|
version = auths[1][1:]
|
||||||
|
return client.Client(version, endpoint_url=url, token=token)
|
||||||
|
|
||||||
|
|
||||||
def get_neutron_client(url, username, tenant_name, password,
|
def get_neutron_client(url, username, tenant_name, password,
|
||||||
|
Loading…
Reference in New Issue
Block a user