Skip to content

Commit

Permalink
Fixed file extension error when installing package
Browse files Browse the repository at this point in the history
Ticket: ENT-12161
Signed-off-by: Victor Moene <[email protected]>
  • Loading branch information
victormlg committed Jan 9, 2025
1 parent cc2f809 commit 5c1160d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cf_remote/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ def install_package(host, pkg, data, *, connection=None):
# sleep is powershell specific,
# timeout doesn't work over ssh.
output = ssh_cmd(connection, powershell(r".\{} ; sleep 10".format(pkg)), True)
else:
# generally this "else" is for rpm packages
elif ".rpm" in pkg:
if "yum" in data["bin"]:
output = ssh_sudo(connection, "yum -y install {}".format(pkg), True)
elif "zypper" in data["bin"]: # suse case
Expand All @@ -276,6 +275,12 @@ def install_package(host, pkg, data, *, connection=None):
log.error(
"Don't know how to install rpm package. No yum or zypper in PATH."
)
else:
file_extension = pkg.split(".")[-1]
if pkg.endswith("tar.gz"):
file_extension = "tar.gz"
log.error("Don't know how to install {} package.".format(file_extension))

if output is None:
log.error("Installation failed on '{}'".format(host))

Expand Down

0 comments on commit 5c1160d

Please sign in to comment.