Skip to content

Commit 235622e

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

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cf_remote/nt-discovery.sh

+1
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

+7-1
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
@@ -515,6 +515,12 @@ def install_host(
515515
return 1
516516

517517
if remote_download:
518+
if data.get("bin") and not data.get("bin").get("curl"):
519+
log.error(
520+
"Couldn't download remotely. Curl is not installed on host '%s'" % host
521+
)
522+
return 1
523+
518524
print("Downloading '%s' on '%s' using curl" % (package, host))
519525
r = ssh_cmd(
520526
cmd="curl --fail -O {}".format(package), connection=connection, errors=True

0 commit comments

Comments
 (0)