Set endpoint interface to gnocchi client
The endpoint_type defined in environment specification/deployment configuration is the endpoint interface for gnocchi. Closes-Bug: #1770593 Change-Id: Ie83f3568fc764d2f1b11f272cc28e4113c016cb1 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
This commit is contained in:
parent
930f5a46dd
commit
fa9d863fb0
@ -67,6 +67,8 @@ Fixed
|
|||||||
valid name for the context (if there is no other ``api_versions`` contexts
|
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
|
for other platforms, but the case of name conflict is covered by another
|
||||||
check).
|
check).
|
||||||
|
* The endpoint_type defined in environment specification/deployment
|
||||||
|
configuration is the endpoint interface for gnocchi.
|
||||||
|
|
||||||
[1.0.0] - 2018-03-28
|
[1.0.0] - 2018-03-28
|
||||||
--------------------
|
--------------------
|
||||||
|
@ -536,7 +536,8 @@ class Gnocchi(OSClient):
|
|||||||
sess = self.keystone.get_session()[0]
|
sess = self.keystone.get_session()[0]
|
||||||
gclient = gnocchi.Client(
|
gclient = gnocchi.Client(
|
||||||
version=self.choose_version(version), session=sess,
|
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
|
return gclient
|
||||||
|
|
||||||
|
|
||||||
|
@ -624,6 +624,7 @@ class OSClientsTestCase(test.TestCase):
|
|||||||
mock_gnocchi.client.Client.return_value = fake_gnocchi
|
mock_gnocchi.client.Client.return_value = fake_gnocchi
|
||||||
mock_keystoneauth1 = mock.MagicMock()
|
mock_keystoneauth1 = mock.MagicMock()
|
||||||
self.assertNotIn("gnocchi", self.clients.cache)
|
self.assertNotIn("gnocchi", self.clients.cache)
|
||||||
|
self.credential["endpoint_type"] = "internal"
|
||||||
with mock.patch.dict("sys.modules",
|
with mock.patch.dict("sys.modules",
|
||||||
{"gnocchiclient": mock_gnocchi,
|
{"gnocchiclient": mock_gnocchi,
|
||||||
"keystoneauth1": mock_keystoneauth1}):
|
"keystoneauth1": mock_keystoneauth1}):
|
||||||
@ -636,7 +637,8 @@ class OSClientsTestCase(test.TestCase):
|
|||||||
self.assertEqual(fake_gnocchi, client)
|
self.assertEqual(fake_gnocchi, client)
|
||||||
kw = {"version": "1",
|
kw = {"version": "1",
|
||||||
"session": mock_keystoneauth1.session.Session(),
|
"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)
|
mock_gnocchi.client.Client.assert_called_once_with(**kw)
|
||||||
self.assertEqual(fake_gnocchi, self.clients.cache["gnocchi"])
|
self.assertEqual(fake_gnocchi, self.clients.cache["gnocchi"])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user