Skip to contentSkip to conversation

fetch2/ssh.py: fix checkstatus

PATCH New [email protected] 1 participant 1 message Sep 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch2/ssh.py: fix checkstatus

From: Pascal Bach <[email protected]>

The output of runfetchcmd is always empty in this case, as the test doesn't produce any output.
SSH either returns 0 or 1, which is handled via exceptions.

This means the current check is not only unnecessary but prevents the function from working.

We can just assume that if we reach the end of the function that the file exists and return True.

---
 lib/bb/fetch2/ssh.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
lib/bb/fetch2/ssh.py +2 -4
index 8d082b38..0cbb2a6f 100644
@@ -150,8 +150,6 @@ class SSH(FetchMethod):
         )
 
         check_network_access(d, cmd, urldata.url)
+        runfetchcmd(cmd, d)
 
-        if runfetchcmd(cmd, d):
-            return True
-
-        return False
+        return True
Signature · 1 line
2.37.3