From f3565724bea66d49c6247ab4bb2ca79f4b8533c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 18 Jan 2019 11:01:22 +0100 Subject: [PATCH] Allow to redirect bus request issue7943 review48691003 --- tryton/bus.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tryton/bus.py b/tryton/bus.py index b804ac816f..206e966418 100644 --- a/tryton/bus.py +++ b/tryton/bus.py @@ -64,9 +64,13 @@ def _listen(connection): wait = 1 continue except Exception as error: - if isinstance(error, HTTPError) and error.code == 501: - logger.info("Bus not supported") - break + if isinstance(error, HTTPError): + if error.code in (301, 302, 303, 307, 308): + url = error.headers.get('Location') + continue + elif error.code == 501: + logger.info("Bus not supported") + break logger.error( "An exception occured while connecting to the bus." "Sleeping for %s seconds",