mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2024-11-24 23:03:08 +00:00
Add a retry loop to fifloader
load_templates often fails for no good reason - see https://progress.opensuse.org/issues/121378 . This makes fifloader retry 20 times on failure to mitigate the issue. Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
309ccc45ee
commit
2c476fded6
12
fifloader.py
12
fifloader.py
@ -340,7 +340,17 @@ def run(args):
|
||||
if args.update:
|
||||
loadargs.append('--update')
|
||||
loadargs.append('-')
|
||||
subprocess.run(loadargs, input=json.dumps(out), text=True, check=True)
|
||||
tries = 20
|
||||
while True:
|
||||
ret = subprocess.run(loadargs, input=json.dumps(out), text=True, check=True)
|
||||
if ret.returncode:
|
||||
if tries:
|
||||
print(f"loader failed! retrying ({tries} attempts remaining)")
|
||||
tries -= 1
|
||||
else:
|
||||
sys.exit("loader failed and all retries exhausted!")
|
||||
else:
|
||||
break
|
||||
|
||||
def main():
|
||||
"""Main loop."""
|
||||
|
Loading…
Reference in New Issue
Block a user