diff mbox series

fetch2/ssh.py: fix checkstatus

Message ID 20220928202554.1596966-1-pascal.bach@siemens.com
State Accepted, archived
Commit d599af48635fab587e5b913591b95daf87b40080
Headers show
Series fetch2/ssh.py: fix checkstatus | expand

Commit Message

Pascal Bach Sept. 28, 2022, 8:25 p.m. UTC
From: Pascal Bach <pascal.bach@siemens.com>

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.

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
---
 lib/bb/fetch2/ssh.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/fetch2/ssh.py b/lib/bb/fetch2/ssh.py
index 8d082b38..0cbb2a6f 100644
--- a/lib/bb/fetch2/ssh.py
+++ b/lib/bb/fetch2/ssh.py
@@ -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