diff --git a/ironic/common/keystone.py b/ironic/common/keystone.py index 9d79ab5db4..ee22ad2a61 100644 --- a/ironic/common/keystone.py +++ b/ironic/common/keystone.py @@ -121,7 +121,7 @@ def get_service_url(session, service_type='baremetal', :returns: an http/https url for the desired endpoint. """ return session.get_endpoint(service_type=service_type, - interface_type=endpoint_type, + interface=endpoint_type, region=CONF.keystone.region_name) diff --git a/ironic/tests/unit/common/test_keystone.py b/ironic/tests/unit/common/test_keystone.py index be5f5a81b7..f55d5089f4 100644 --- a/ironic/tests/unit/common/test_keystone.py +++ b/ironic/tests/unit/common/test_keystone.py @@ -56,6 +56,9 @@ class KeystoneTestCase(base.TestCase): mock_sess = mock.Mock() mock_sess.get_endpoint.return_value = fake_url res = keystone.get_service_url(mock_sess) + mock_sess.get_endpoint.assert_called_with( + interface='internal', region='fake_region', + service_type='baremetal') self.assertEqual(fake_url, res) def test_get_url_failure(self):