From b79d6f46d55bdf63831d24827f9725189a69f5c6 Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Tue, 6 Sep 2016 13:44:22 +0300 Subject: [PATCH] [osclients] Fix zaqar client While porting to obtaining auth_ref from keystoneauth library, we missed the way how zaqar obtains project_id. This patch fixes it. Change-Id: I00dc126fa1a19298e5c90ea08c9a39800f0615a9 --- rally/osclients.py | 2 +- tests/unit/test_osclients.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rally/osclients.py b/rally/osclients.py index 6a7803610a..de5402b899 100644 --- a/rally/osclients.py +++ b/rally/osclients.py @@ -531,7 +531,7 @@ class Zaqar(OSClient): def create_client(self, version=None, service_type=None): """Return Zaqar client.""" from zaqarclient.queues import client as zaqar - tenant_id = self.keystone.auth_ref.get("token").get("tenant").get("id") + tenant_id = self.keystone.auth_ref.project_id conf = {"auth_opts": {"backend": "keystone", "options": { "os_username": self.credential.username, "os_password": self.credential.password, diff --git a/tests/unit/test_osclients.py b/tests/unit/test_osclients.py index d2b576ba84..7dc9468d87 100644 --- a/tests/unit/test_osclients.py +++ b/tests/unit/test_osclients.py @@ -574,7 +574,7 @@ class OSClientsTestCase(test.TestCase): mock_zaqar = mock.MagicMock() mock_zaqar.client.Client = mock.MagicMock(return_value=fake_zaqar) self.assertNotIn("zaqar", self.clients.cache) - p_id = self.auth_ref.get("token").get("tenant").get("id") + p_id = self.auth_ref.project_id with mock.patch.dict("sys.modules", {"zaqarclient.queues": mock_zaqar}): client = self.clients.zaqar()