changeset ec6e6f31b244 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=ec6e6f31b244
description:
Allow to redirect bus request
issue7943
review48691003
diffstat:
tryton/bus.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diffs (20 lines):
diff -r 315f030e75ff -r ec6e6f31b244 tryton/bus.py
--- a/tryton/bus.py Mon Jan 07 21:57:13 2019 +0100
+++ b/tryton/bus.py Fri Jan 18 11:01:22 2019 +0100
@@ -64,9 +64,13 @@
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",