fix: Try to prevent OBS net hiccups on 3.4 branch #342

Open
eminguez wants to merge 1 commits from eminguez/suse-edge-factory:wait-obs-3.4 into 3.4

View File

@@ -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()
main()