From 99b7a3d1d15813fd8d07aa36636feb44516dc523 Mon Sep 17 00:00:00 2001 From: Quique Llorente Date: Wed, 19 Sep 2018 13:00:54 +0200 Subject: [PATCH] Add a guard to break if no connection If the WebSocket connection is already disconnected we don't have to wait for messages Change-Id: I7543c8e61711f036140db20416a57447da6c4c18 Closes-Bug: #1793264 --- tripleoclient/plugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tripleoclient/plugin.py b/tripleoclient/plugin.py index 66ad03f4a..3198f3010 100644 --- a/tripleoclient/plugin.py +++ b/tripleoclient/plugin.py @@ -138,6 +138,9 @@ class WebsocketClient(object): messages. """ + if not self._ws.connected: + return + if timeout is None: LOG.warning("Waiting for messages on queue '{}' with no timeout." .format(self._queue_name))