Use the messaging-websocket endpoint
We now have a separate endpoint specifically for Zaqar websocket support so lets use it. Change-Id: I4c6ee4623205402bf7419f95f22bbf03f18f0ddb
This commit is contained in:
@@ -70,17 +70,15 @@ class WebsocketClient(object):
|
||||
self._queue_name = queue_name
|
||||
|
||||
endpoint = instance.get_endpoint_for_service_type(
|
||||
'messaging')
|
||||
'messaging-websocket')
|
||||
token = instance.auth.get_token(instance.session)
|
||||
|
||||
self._project_id = instance.auth_ref.project_id
|
||||
|
||||
self._websocket_client_id = str(uuid.uuid4())
|
||||
|
||||
# FIXME(dprince): add messaging-websocket to the keystone catalog
|
||||
ws_url = endpoint.replace('http', 'ws').replace('8888', '9000')
|
||||
LOG.debug('Instantiating messaging websocket client: %s', ws_url)
|
||||
self._ws = websocket.create_connection(ws_url)
|
||||
LOG.debug('Instantiating messaging websocket client: %s', endpoint)
|
||||
self._ws = websocket.create_connection(endpoint)
|
||||
|
||||
self.send('authenticate', extra_headers={'X-Auth-Token': token})
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import sys
|
||||
|
||||
AUTH_TOKEN = "foobar"
|
||||
AUTH_URL = "http://0.0.0.0"
|
||||
WS_URL = "ws://0.0.0.0"
|
||||
|
||||
|
||||
class FakeApp(object):
|
||||
|
||||
@@ -25,7 +25,7 @@ class TestPlugin(base.TestCase):
|
||||
@mock.patch("websocket.create_connection")
|
||||
def test_make_client(self, ws_create_connection):
|
||||
clientmgr = mock.MagicMock()
|
||||
clientmgr.get_endpoint_for_service_type.return_value = fakes.AUTH_URL
|
||||
clientmgr.get_endpoint_for_service_type.return_value = fakes.WS_URL
|
||||
|
||||
clientmgr.auth.get_token.return_value = "TOKEN"
|
||||
clientmgr.auth_ref.project_id = "ID"
|
||||
@@ -70,7 +70,7 @@ class TestPlugin(base.TestCase):
|
||||
}, send_ack]
|
||||
|
||||
clientmgr = mock.MagicMock()
|
||||
clientmgr.get_endpoint_for_service_type.return_value = fakes.AUTH_URL
|
||||
clientmgr.get_endpoint_for_service_type.return_value = fakes.WS_URL
|
||||
clientmgr.auth.get_token.return_value = "TOKEN"
|
||||
clientmgr.auth_ref.project_id = "ID"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user