From 63a9f85849bf50420aec39d0e9e1c6f85da8a62a Mon Sep 17 00:00:00 2001 From: shylesh Date: Thu, 23 May 2024 13:27:55 +0530 Subject: [PATCH] Increase sleep time for oc extract (#9814) Signed-off-by: Shylesh Kumar Mohan --- ocs_ci/deployment/acm.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ocs_ci/deployment/acm.py b/ocs_ci/deployment/acm.py index 852f71f9926..ec710adc130 100644 --- a/ocs_ci/deployment/acm.py +++ b/ocs_ci/deployment/acm.py @@ -7,7 +7,7 @@ import tempfile import shutil import requests -import time +import subprocess import semantic_version import platform @@ -190,19 +190,23 @@ 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) - target_dir = os.path.expanduser("./bin") + 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 = config.RUN["bin_dir"] install_cmd = ( f"install -m744 /tmp/subctl-{version_str}*/subctl-{version_str}*-linux-{binary_pltfrm} " f"{target_dir} " ) 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): """