diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e9025ebc..f06d965d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -67,6 +67,8 @@ Fixed valid name for the context (if there is no other ``api_versions`` contexts for other platforms, but the case of name conflict is covered by another check). +* The endpoint_type defined in environment specification/deployment + configuration is the endpoint interface for gnocchi. [1.0.0] - 2018-03-28 -------------------- diff --git a/rally_openstack/osclients.py b/rally_openstack/osclients.py index 503e79a3..457a35c0 100644 --- a/rally_openstack/osclients.py +++ b/rally_openstack/osclients.py @@ -536,7 +536,8 @@ class Gnocchi(OSClient): sess = self.keystone.get_session()[0] gclient = gnocchi.Client( version=self.choose_version(version), session=sess, - adapter_options={"service_type": service_type}) + adapter_options={"service_type": service_type, + "interface": self.credential.endpoint_type}) return gclient diff --git a/tests/unit/test_osclients.py b/tests/unit/test_osclients.py index c2de971d..46f2165a 100644 --- a/tests/unit/test_osclients.py +++ b/tests/unit/test_osclients.py @@ -624,6 +624,7 @@ class OSClientsTestCase(test.TestCase): mock_gnocchi.client.Client.return_value = fake_gnocchi mock_keystoneauth1 = mock.MagicMock() self.assertNotIn("gnocchi", self.clients.cache) + self.credential["endpoint_type"] = "internal" with mock.patch.dict("sys.modules", {"gnocchiclient": mock_gnocchi, "keystoneauth1": mock_keystoneauth1}): @@ -636,7 +637,8 @@ class OSClientsTestCase(test.TestCase): self.assertEqual(fake_gnocchi, client) kw = {"version": "1", "session": mock_keystoneauth1.session.Session(), - "adapter_options": {"service_type": "metric"}} + "adapter_options": {"service_type": "metric", + "interface": "internal"}} mock_gnocchi.client.Client.assert_called_once_with(**kw) self.assertEqual(fake_gnocchi, self.clients.cache["gnocchi"])