Skip to content

Commit

Permalink
Merge pull request #111 from victormlg/ENT-12161-handle-wrong-package
Browse files Browse the repository at this point in the history
Fixed file extension error when installing package
  • Loading branch information
olehermanse authored Jan 9, 2025
2 parents cc2f809 + 5c1160d commit 43d720e
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 43d720e

Please sign in to comment.