fetch-job: handle all exceptions and continue the fetch-loop Before this change only the TimeoutExpired exception was handled, any other exception would exit the for loop. However, even the handling of the TimeoutExpired exception would call sys.exit(1) after printing out the error. Change-Id: Ie55d83c302b9838ec147ace838e202d6c1a9e14f
diff --git a/container-images/fetch-job/tools/fetch-job.py b/container-images/fetch-job/tools/fetch-job.py index 55267d5..28d3ff6 100755 --- a/container-images/fetch-job/tools/fetch-job.py +++ b/container-images/fetch-job/tools/fetch-job.py
@@ -77,13 +77,11 @@ print(f"Fetching {remote_repo} from {remote_name} into {git_repo}") try: git_repo.fetch(remote_name, timeout=timeout_seconds) - except subprocess.TimeoutExpired: + except Exception as e: print( - f"ERROR: fetch of {remote_repo} from {remote_name} timed out " - f"after {timeout_seconds}s", + f"ERROR: fetch of {remote_repo} from {remote_name} failed: {e}", file=sys.stderr, ) - sys.exit(1) def main():