From 87cbf38a294be379f15bfa0c824595a312cd2fc7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Wed, 18 Dec 2019 15:27:38 +0100 Subject: [PATCH] Treat xmlrpc error 504 differently The error message for the error 504 reads: In other words, the request succeeded but the user does not exist. So in those situation there are no reasons to keep on trying, it won't work at the next attempt either. Signed-off-by: Pierre-Yves Chibon --- distgit_bugzilla_sync/script.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/distgit_bugzilla_sync/script.py b/distgit_bugzilla_sync/script.py index bd9b099..f3d86b1 100644 --- a/distgit_bugzilla_sync/script.py +++ b/distgit_bugzilla_sync/script.py @@ -453,6 +453,10 @@ class BugzillaProxy: self.server.editcomponent(data) break except Exception as e: + if isinstance(e, xmlrpc.client.Fault) and e.faultCode == 504: + if self.config['verbose']: + print(f" ERROR {e}") + raise if i >= num_attempts - 1: raise if self.config['verbose']: @@ -523,6 +527,10 @@ class BugzillaProxy: self.server.addcomponent(data) break except Exception as e: + if isinstance(e, xmlrpc.client.Fault) and e.faultCode == 504: + if self.config['verbose']: + print(f" ERROR {e}") + raise if i >= num_attempts - 1: raise if self.config['verbose']: