Skip to content

Commit 08b1008

Browse files
committed
Tightened command not found check
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
1 parent af919ca commit 08b1008

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

cf_remote/remote.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,10 @@ def get_info(host, *, users=None, connection=None):
220220
# Note: ssh_cmd is supposed to return None on failure however, it seems
221221
# like there are some cases where it returns output on failure
222222
# because the exit code was 0
223-
# TODO: systeminfo has a lot of output normally, looking for
224-
# "command not found" in this output is not very robust.
225-
if systeminfo and "command not found" not in systeminfo:
223+
# TODO / Workaround:
224+
if systeminfo == "bash: systeminfo: command not found":
225+
systeminfo = None
226+
if systeminfo:
226227
data["os"] = "windows"
227228
data["systeminfo"] = parse_systeminfo(systeminfo)
228229
data["package_tags"] = ["x86_64", "msi"]

0 commit comments

Comments
 (0)