From 43c730ae10e7f06638deee5d7e975b53332764bf Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 20 Aug 2020 21:43:23 +0000 Subject: [PATCH] oscontainer: Remove unused retry code We fixed the core issues around pushing the oscontainer, so this has been dead code for a while. --- src/oscontainer.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/oscontainer.py b/src/oscontainer.py index e676974996..14b89e9405 100755 --- a/src/oscontainer.py +++ b/src/oscontainer.py @@ -19,8 +19,6 @@ import os import shutil import subprocess -from functools import wraps -from time import sleep from cosalib import cmdlib OSCONTAINER_COMMIT_LABEL = 'com.coreos.ostree-commit' @@ -29,31 +27,6 @@ NESTED_BUILD_ARGS = ['--storage-driver', 'vfs'] -# oscontainer.py can't use external python libs since its running in RHCOS -def retry(attempts=5): - def retry_decorator(f): - - @wraps(f) - def retry_function(*args, **kwargs): - delay = 5 - i = attempts - while i > 1: - try: - return f(*args, **kwargs) - except subprocess.CalledProcessError as e: - print(f"{str(e)}, retrying in {delay} seconds...") - sleep(delay) - i -= 1 - return f(*args, **kwargs) - return retry_function - return retry_decorator - - -@retry(attempts=5) -def run_get_json_retry(args): - return run_get_json(args) - - def run_get_json(args): return json.loads(subprocess.check_output(args))