Merge "Can not create Gnocchi client due to deprecated session options"

This commit is contained in:
Zuul 2017-12-21 18:29:15 +00:00 committed by Gerrit Code Review
commit 3d49746d74
2 changed files with 4 additions and 3 deletions

View File

@ -512,8 +512,9 @@ class Gnocchi(OSClient):
service_type = self.choose_service_type(service_type) service_type = self.choose_service_type(service_type)
sess = self.keystone.get_session()[0] sess = self.keystone.get_session()[0]
gclient = gnocchi.Client(version=self.choose_version( gclient = gnocchi.Client(
version), session=sess, service_type=service_type) version=self.choose_version(version), session=sess,
adapter_options={"service_type": service_type})
return gclient return gclient

View File

@ -618,7 +618,7 @@ 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(),
"service_type": "metric"} "adapter_options": {"service_type": "metric"}}
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"])