oscontainer: Remove unused retry code
We fixed the core issues around pushing the oscontainer, so
this has been dead code for a while.
@@ -19,8 +19,6 @@ import json
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 @@ OSCONTAINER_COMMIT_LABEL = 'com.coreos.ostree-commit'
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))
