diff --git a/watcher/common/clients.py b/watcher/common/clients.py index 6ad35ea36..047840004 100755 --- a/watcher/common/clients.py +++ b/watcher/common/clients.py @@ -110,8 +110,12 @@ class OpenStackClients(object): 'api_version') gnocchiclient_interface = self._get_client_option('gnocchi', 'endpoint_type') + adapter_options = { + "interface": gnocchiclient_interface + } + self._gnocchi = gnclient.Client(gnocchiclient_version, - interface=gnocchiclient_interface, + adapter_options=adapter_options, session=self.session) return self._gnocchi diff --git a/watcher/tests/common/test_clients.py b/watcher/tests/common/test_clients.py index fc4b5864f..3511d813a 100755 --- a/watcher/tests/common/test_clients.py +++ b/watcher/tests/common/test_clients.py @@ -190,7 +190,8 @@ class TestClients(base.TestCase): osc.gnocchi() mock_call.assert_called_once_with( CONF.gnocchi_client.api_version, - interface=CONF.gnocchi_client.endpoint_type, + adapter_options={ + "interface": CONF.gnocchi_client.endpoint_type}, session=mock_session) @mock.patch.object(clients.OpenStackClients, 'session')