diff --git a/ocs_ci/deployment/acm.py b/ocs_ci/deployment/acm.py index 852f71f99264..7a737b5f8862 100644 --- a/ocs_ci/deployment/acm.py +++ b/ocs_ci/deployment/acm.py @@ -8,6 +8,7 @@ import shutil import requests import time +import subprocess import semantic_version import platform @@ -190,12 +191,15 @@ def download_downstream_binary(self): f'--path="/dist/subctl-{version_str}*-linux-{binary_pltfrm}.tar.xz":/tmp --confirm' ) run_cmd(cmd) - # Wait till image extract happens and subctl dir appears - time.sleep(30) decompress = ( f"tar -C /tmp/ -xf /tmp/subctl-{version_str}*-linux-{binary_pltfrm}.tar.xz" ) - run_cmd(decompress) + p = subprocess.run(decompress, stdout=subprocess.PIPE, shell=True) + if p.returncode: + logger.error("Failed to untar subctl") + raise CommandFailed + else: + logger.info(p.stdout) target_dir = os.path.expanduser("./bin") install_cmd = ( f"install -m744 /tmp/subctl-{version_str}*/subctl-{version_str}*-linux-{binary_pltfrm} " @@ -203,6 +207,7 @@ def download_downstream_binary(self): ) run_cmd(install_cmd, shell=True) run_cmd(f"mv {target_dir}/subctl-* {target_dir}/subctl", shell=True) + os.environ["PATH"] = os.environ["PATH"] + ":" + os.path.abspath(f"{target_dir}") def submariner_configure_upstream(self): """