diff --git a/devstack/plugin.sh b/devstack/plugin.sh index e66706d85..eee108181 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -162,7 +162,7 @@ function configure_inspector { cp "$IRONIC_INSPECTOR_DIR/example.conf" "$IRONIC_INSPECTOR_CONF_FILE" inspector_iniset DEFAULT debug $IRONIC_INSPECTOR_DEBUG - inspector_iniset ironic os_auth_url "$KEYSTONE_SERVICE_URI/v2.0" + inspector_iniset ironic os_auth_url "$KEYSTONE_SERVICE_URI" inspector_iniset ironic os_username $IRONIC_INSPECTOR_ADMIN_USER inspector_iniset ironic os_password $SERVICE_PASSWORD inspector_iniset ironic os_tenant_name $SERVICE_TENANT_NAME diff --git a/ironic_inspector/test/test_utils.py b/ironic_inspector/test/test_utils.py index 748102fd6..c7bc9a90b 100644 --- a/ironic_inspector/test/test_utils.py +++ b/ironic_inspector/test/test_utils.py @@ -15,7 +15,7 @@ import socket import unittest from ironicclient import client -import keystoneclient.v2_0.client as keystone_client +from keystoneclient import client as keystone_client from keystonemiddleware import auth_token from oslo_config import cfg @@ -70,7 +70,7 @@ class TestCheckAuth(base.BaseTest): CONF.set_override('admin_user', 'admin', 'keystone_authtoken') CONF.set_override('admin_tenant_name', 'admin', 'keystone_authtoken') CONF.set_override('admin_password', 'password', 'keystone_authtoken') - CONF.set_override('auth_uri', 'http://127.0.0.1:5000/v2.0', + CONF.set_override('auth_uri', 'http://127.0.0.1:5000', 'keystone_authtoken') CONF.set_override('identity_uri', 'http://127.0.0.1:35357', 'keystone_authtoken') @@ -87,7 +87,7 @@ class TestCheckAuth(base.BaseTest): self.assertEqual('admin', args1['admin_tenant_name']) self.assertEqual('password', args1['admin_password']) self.assertTrue(args1['delay_auth_decision']) - self.assertEqual('http://127.0.0.1:5000/v2.0', args1['auth_uri']) + self.assertEqual('http://127.0.0.1:5000', args1['auth_uri']) self.assertEqual('http://127.0.0.1:35357', args1['identity_uri']) @mock.patch.object(auth_token, 'AuthProtocol') diff --git a/ironic_inspector/utils.py b/ironic_inspector/utils.py index 211806a1e..2deee8760 100644 --- a/ironic_inspector/utils.py +++ b/ironic_inspector/utils.py @@ -17,7 +17,7 @@ import socket import eventlet from ironicclient import client -import keystoneclient.v2_0.client as keystone_client +from keystoneclient import client as keystone_client from keystonemiddleware import auth_token from oslo_config import cfg from oslo_log import log @@ -170,6 +170,9 @@ def get_client(token=None, 'auth_url': CONF.ironic.os_auth_url, 'tenant_name': CONF.ironic.os_tenant_name} keystone = keystone_client.Client(**keystone_creds) + # FIXME(sambetts): Work around for Bug 1539839 as client.authenticate + # is not called. + keystone.authenticate() ironic_url = keystone.service_catalog.url_for( service_type=CONF.ironic.os_service_type, endpoint_type=CONF.ironic.os_endpoint_type)