Merge "Adding version for neutronclient"

This commit is contained in:
Jenkins 2015-12-16 11:50:49 +00:00 committed by Gerrit Code Review
commit a503a82464
4 changed files with 7 additions and 5 deletions

View File

@ -50,7 +50,7 @@ neutron_opts = [
keystone_opts = [
cfg.StrOpt('auth_uri',
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.')),
cfg.StrOpt('admin_user',
default=os.environ.get('SERVICE_USER'),

View File

@ -53,7 +53,7 @@ def neutron_client():
password=password, auth_url=auth_uri)
else:
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.neutron.format = 'json'

View File

@ -35,7 +35,7 @@ class ConfigurationTest(base.TestKuryrBase):
self.assertEqual('http://127.0.0.1:9696',
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)
def test_check_for_neutron_ext_support_with_ex(self):

View File

@ -29,8 +29,10 @@ DOCKER_NETNS_BASE = '/var/run/docker/netns'
PORT_POSTFIX = 'port'
def get_neutron_client_simple(url, token):
return client.Client('2.0', endpoint_url=url, token=token)
def get_neutron_client_simple(url, auth_url, 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,