From 3414ac47df3976728b76457000a81f064296103361517170f66bf3e6482ad0db Mon Sep 17 00:00:00 2001 From: e-minguez Date: Wed, 17 Dec 2025 12:08:31 +0100 Subject: [PATCH] fix: Try to prevent OBS net hiccups (cherry picked from commit 8852fdad20893e23677d811d48ec49f783e7bafca9d22e4387ee9132d7538a49) --- .obs/wait_obs.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.obs/wait_obs.py b/.obs/wait_obs.py index 5fe1501..001ce7c 100644 --- a/.obs/wait_obs.py +++ b/.obs/wait_obs.py @@ -12,6 +12,8 @@ def get_buildstatus(project: str) -> ET.Element: output = subprocess.check_output(["osc", "pr", "--xml", project]) return ET.fromstring(output) except subprocess.CalledProcessError: + # Don't retry immediatly just in case is a network error + time.sleep(5) continue print("Failed to get buildstatus from OBS") @@ -20,6 +22,12 @@ def do_wait(project:str, commit:str) -> ET.Element: while True: time.sleep(5) status = get_buildstatus(project) + + # Just in case the buildstatus fails + if status is None: + print("Could not retrieve status, retrying...") + continue + if last_state == status.get("state"): continue else: @@ -80,4 +88,4 @@ def main(): sys.exit(print_results(status)) if __name__ == "__main__": - main() \ No newline at end of file + main() -- 2.51.1