From 5935afe40c5ac3b3ab5656dc467b905a0f9081a1 Mon Sep 17 00:00:00 2001 From: Thomas Herve Date: Wed, 28 Nov 2018 16:12:35 +0100 Subject: [PATCH] Catch websocket connection close errors in cleanup This can add useless noise when we have timeouts in particular. Change-Id: I55d18885f06e530ff9a5492c0b98f37525e88ed6 Closes-Bug: #1805647 --- tripleoclient/plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tripleoclient/plugin.py b/tripleoclient/plugin.py index 1f9b9eb9c..87a922454 100644 --- a/tripleoclient/plugin.py +++ b/tripleoclient/plugin.py @@ -167,7 +167,10 @@ class WebsocketClient(object): def __exit__(self, *exc): """Call cleanup when exiting the context manager""" - self.cleanup() + try: + self.cleanup() + except websocket.WebSocketConnectionClosedException: + pass class ClientWrapper(object):