Skip to content

Commit

Permalink
move get_openshift_mirror_url to try block
Browse files Browse the repository at this point in the history
Signed-off-by: vavuthu <[email protected]>
  • Loading branch information
vavuthu committed Jul 1, 2024
1 parent 47d4f8c commit aea9815
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ocs_ci/utility/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,14 +1084,15 @@ def get_openshift_client(
# record current working directory and switch to BIN_DIR
previous_dir = os.getcwd()
os.chdir(bin_dir)
url = get_openshift_mirror_url("openshift-client", version)

tarball = "openshift-client.tar.gz"
try:
url = get_openshift_mirror_url("openshift-client", version)
download_file(url, tarball)
run_cmd(f"tar xzvf {tarball} oc kubectl")
delete_file(tarball)
except Exception as e:
log.error(f"Failed to download the url {url} with exception '{e}'")
log.error(f"Failed to download the openshift client.Exception '{e}'")
# check given version is GA'ed or not
if "nightly" in version:
get_nightly_oc_via_ga(version, tarball)
Expand Down

0 comments on commit aea9815

Please sign in to comment.