diff --git a/kuryr/common/config.py b/kuryr/common/config.py index 9341d742..d2b39512 100644 --- a/kuryr/common/config.py +++ b/kuryr/common/config.py @@ -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'), diff --git a/kuryr/controllers.py b/kuryr/controllers.py index 64020562..f9002d1a 100644 --- a/kuryr/controllers.py +++ b/kuryr/controllers.py @@ -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' diff --git a/kuryr/tests/unit/test_config.py b/kuryr/tests/unit/test_config.py index 338007d9..8a99b021 100644 --- a/kuryr/tests/unit/test_config.py +++ b/kuryr/tests/unit/test_config.py @@ -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): diff --git a/kuryr/utils.py b/kuryr/utils.py index 75bdd628..1a7cf0a0 100644 --- a/kuryr/utils.py +++ b/kuryr/utils.py @@ -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,