From 1f03120564becaabce3efbf31965058ca7fa72c9 Mon Sep 17 00:00:00 2001 From: Simon Halvorsen Date: Tue, 25 Aug 2026 13:04:37 +0200 Subject: [PATCH] Added cf-hub's path to get_info Ticket: CFE-4707 Changelog: Title Signed-off-by: Simon Halvorsen --- cf_remote/nt-discovery.sh | 4 +++- cf_remote/remote.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cf_remote/nt-discovery.sh b/cf_remote/nt-discovery.sh index e476c3c..cb8aa4d 100644 --- a/cf_remote/nt-discovery.sh +++ b/cf_remote/nt-discovery.sh @@ -62,7 +62,9 @@ run_command "cat /var/cfengine/policy_server.dat" "POLICY_SERVER" # cf-hub cfhub_path=$(cf_path "cf-hub") -run_command "$cfhub_path --version" "CFHUB" "Cannot find cf-hub" + +run_command "command -v $cfhub_path" "CFHUB_PATH" "Cannot find cf-hub" +run_command "$cfhub_path --version" "CFHUB_VERSION" # packages diff --git a/cf_remote/remote.py b/cf_remote/remote.py index 66b7a6e..82269f8 100644 --- a/cf_remote/remote.py +++ b/cf_remote/remote.py @@ -288,8 +288,10 @@ def get_info(host, *, users=None, connection=None): data["agent"] = discovery.get("NTD_CFAGENT_PATH") data["policy_server"] = discovery.get("NTD_POLICY_SERVER") data["agent_version"] = parse_version(discovery.get("NTD_CFAGENT_VERSION")) - if discovery.get("NTD_CFHUB"): + hub_path = discovery.get("NTD_CFHUB_PATH") + if hub_path: data["role"] = "hub" + data["hub"] = hub_path elif discovery.get("NTD_CFAGENT_PATH"): data["role"] = "client" else: