diff --git a/examples/keystone_auth.py b/examples/keystone_auth.py index c5f90fb8..16a5b8cd 100644 --- a/examples/keystone_auth.py +++ b/examples/keystone_auth.py @@ -33,7 +33,7 @@ def create_post_delete(queue_name, messages): {'backend': 'keystone', 'options': {'os_username': 'zaqar', 'os_password': 'zaqar', - 'project_id': 'ccad479c402f43a2994f6e372ab3f8fe', + 'os_project_id': 'ccad479c402f43a2994f6e372ab3f8fe', 'os_project_name': '', 'os_auth_url': 'http://127.0.0.1:5000/v2.0/', 'insecure': ''} diff --git a/examples/signed_url_auth.py b/examples/signed_url_auth.py index 5d028c35..0239f526 100644 --- a/examples/signed_url_auth.py +++ b/examples/signed_url_auth.py @@ -34,7 +34,7 @@ def create_post_delete(queue_name, messages): 'expires': '', 'methods': ['GET', 'PATCH', 'POST', 'PUT'], 'paths': ['/v2/queues/beijing/claims'], - 'project_id': '2887aabf368046a3bb0070f1c0413470'} + 'os_project_id': '2887aabf368046a3bb0070f1c0413470'} } } cli = client.Client(URL, conf=conf) diff --git a/tests/unit/transport/test_request.py b/tests/unit/transport/test_request.py index 23318041..53f11470 100644 --- a/tests/unit/transport/test_request.py +++ b/tests/unit/transport/test_request.py @@ -27,7 +27,7 @@ class TestRequest(base.TestBase): def test_request_project_id(self): auth_opts = { 'options': { - 'project_id': 'my-project' + 'os_project_id': 'my-project' } } auth_opts.update({'backend': 'noauth'}) diff --git a/tests/unit/transport/test_ws.py b/tests/unit/transport/test_ws.py index 6e036649..aad30de5 100644 --- a/tests/unit/transport/test_ws.py +++ b/tests/unit/transport/test_ws.py @@ -25,7 +25,7 @@ class TestWsTransport(base.TestBase): os_opts = { 'os_auth_token': 'FAKE_TOKEN', 'os_auth_url': 'http://127.0.0.0:5000/v3', - 'project_id': 'admin', + 'os_project_id': 'admin', 'os_service_type': 'messaging-websocket', } auth_opts = {'backend': 'keystone', diff --git a/zaqarclient/tests/base.py b/zaqarclient/tests/base.py index c23affb2..173b22e8 100644 --- a/zaqarclient/tests/base.py +++ b/zaqarclient/tests/base.py @@ -37,7 +37,7 @@ class TestBase(testtools.TestCase): 'auth_opts': { 'backend': 'noauth', 'options': { - 'project_id': 'my-project' + 'os_project_id': 'my-project' } } } @@ -90,7 +90,7 @@ class TestBase(testtools.TestCase): options = {'os_username': self.creds['username'], 'os_password': self.creds['password'], 'os_project_name': self.creds['project_name'], - 'project_id': '', + 'os_project_id': '', 'os_auth_url': auth_url} self.conf['auth_opts'].setdefault('options', {}).update(options) diff --git a/zaqarclient/tests/queues/queues.py b/zaqarclient/tests/queues/queues.py index fb351f7e..88ca1d29 100644 --- a/zaqarclient/tests/queues/queues.py +++ b/zaqarclient/tests/queues/queues.py @@ -600,7 +600,7 @@ class QueuesV2QueueFunctionalTest(QueuesV1_1QueueFunctionalTest): 'expires': signature['expires'], 'methods': signature['methods'], 'signature': signature['signature'], - 'project_id': signature['project'], + 'os_project_id': signature['project'], } auth_opts = {'backend': 'signed-url', 'options': opts} diff --git a/zaqarclient/transport/request.py b/zaqarclient/transport/request.py index cb698cd5..8a9821a2 100644 --- a/zaqarclient/transport/request.py +++ b/zaqarclient/transport/request.py @@ -45,7 +45,7 @@ def prepare_request(auth_opts=None, data=None, **kwargs): auth_backend = auth.get_backend(**(auth_opts or {})) req = auth_backend.authenticate(kwargs.get('api'), req) - project_id = auth_opts.get('options', {}).get('project_id', None) + project_id = auth_opts.get('options', {}).get('os_project_id', {}) # Let's add project id header, only if it will have non-empty value. if project_id: diff --git a/zaqarclient/transport/ws.py b/zaqarclient/transport/ws.py index b55355a5..ab22d1ef 100644 --- a/zaqarclient/transport/ws.py +++ b/zaqarclient/transport/ws.py @@ -42,7 +42,7 @@ class WebsocketTransport(base.Transport): 'backend': 'keystone', 'options': { 'os_auth_token': ks.auth_token, - 'project_id': CONF.zaqar.project_id + 'os_project_id': CONF.zaqar.project_id } } } @@ -57,7 +57,7 @@ class WebsocketTransport(base.Transport): """ def __init__(self, options): super(WebsocketTransport, self).__init__(options) - self._project_id = options['auth_opts']['options']['project_id'] + self._project_id = options['auth_opts']['options']['os_project_id'] self._token = options['auth_opts']['options']['os_auth_token'] self._websocket_client_id = None self._ws = None