From patchwork Wed Sep 28 20:25:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pascal Bach X-Patchwork-Id: 13353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BC67C6FA82 for ; Wed, 28 Sep 2022 20:26:11 +0000 (UTC) Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net [185.136.64.226]) by mx.groups.io with SMTP id smtpd.web12.2647.1664396762262968239 for ; Wed, 28 Sep 2022 13:26:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=pascal.bach@siemens.com header.s=fm1 header.b=aUyymb7q; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.226, mailfrom: fm-402798-20220928202558dfa95998f850b705bc-_tnjeo@rts-flowmailer.siemens.com) Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 20220928202558dfa95998f850b705bc for ; Wed, 28 Sep 2022 22:25:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=pascal.bach@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=ZOCJOLU0hNfXpHn4HV358trJqkJw2kKMpejSzeZOHnU=; b=aUyymb7qoRIvMucNef94bzyOPm/S91eek5w9neE1xLR+fcqTp5g5idRPe6WMJHrrQ+6OVI eP58+y0hWbxvwBo7lafgvGvvAhYS/1z2o9aX+3/C8M7gPH0hEdBBhtl/Cr81FBkW+mgW6tUO +BVarfS4Xggk3/S2bl+Fz7OM4l0dM=; From: pascal.bach@siemens.com To: bitbake-devel@lists.openembedded.org Cc: Pascal Bach Subject: [PATCH] fetch2/ssh.py: fix checkstatus Date: Wed, 28 Sep 2022 22:25:54 +0200 Message-Id: <20220928202554.1596966-1-pascal.bach@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-402798:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 28 Sep 2022 20:26:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/13995 From: Pascal Bach 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 --- lib/bb/fetch2/ssh.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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