Skip to content

Commit

Permalink
oscontainer: Remove unused retry code
Browse files Browse the repository at this point in the history
We fixed the core issues around pushing the oscontainer, so
this has been dead code for a while.
  • Loading branch information
cgwalters authored and openshift-merge-robot committed Aug 20, 2020
1 parent 8b41409 commit 43c730a
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/oscontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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))

Expand Down

0 comments on commit 43c730a

Please sign in to comment.