Skip to content

Commit 06b1b00

Browse files
committed
Added curl installation check when remote download
Ticket: CFE-4405 Signed-off-by: Victor Moene <[email protected]>
1 parent 3cfe5b5 commit 06b1b00

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cf_remote/nt-discovery.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ run_command "command -v yum" "YUM" "Cannot find yum"
5151
run_command "command -v apt" "APT" "Cannot find apt"
5252
run_command "command -v pkg" "PKG" "Cannot find pkg"
5353
run_command "command -v zypper" "ZYPPER" "Cannot find zypper"
54+
run_command "command -v curl" "CURL" "Cannot find curl"
5455

cf_remote/remote.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def get_info(host, *, users=None, connection=None):
255255
data["agent_version"] = parse_version(discovery.get("NTD_CFAGENT_VERSION"))
256256

257257
data["bin"] = {}
258-
for bin in ["dpkg", "rpm", "yum", "apt", "pkg", "zypper"]:
258+
for bin in ["dpkg", "rpm", "yum", "apt", "pkg", "zypper", "curl"]:
259259
path = discovery.get("NTD_{}".format(bin.upper()))
260260
if path:
261261
data["bin"][bin] = path
@@ -514,6 +514,12 @@ def install_host(
514514
log.error("Installation failed - no package found!")
515515
return 1
516516

517+
if data.get("bin") and not data.get("bin").get("curl"):
518+
log.error(
519+
"Couldn't download remotely. Curl is not installed on host '%s'" % host
520+
)
521+
return 1
522+
517523
if remote_download:
518524
print("Downloading '%s' on '%s' using curl" % (package, host))
519525
r = ssh_cmd(

0 commit comments

Comments
 (0)