[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
This commit is contained in:
Andrey Kurilin 2016-09-06 13:44:22 +03:00
parent d701c6317a
commit b79d6f46d5
2 changed files with 2 additions and 2 deletions

View File

@ -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,

View File

@ -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()