Message ID | 20190108123834.2225-1-alialnu@mellanox.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43YsKx0z2rz9sDL for <incoming@patchwork.ozlabs.org>; Tue, 8 Jan 2019 23:40:21 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="a4dKYVsH"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43YsKw41wCzDqTw for <incoming@patchwork.ozlabs.org>; Tue, 8 Jan 2019 23:40:20 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=40.107.5.89; helo=eur03-ve1-obe.outbound.protection.outlook.com; envelope-from=alialnu@mellanox.com; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="a4dKYVsH"; dkim-atps=neutral Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50089.outbound.protection.outlook.com [40.107.5.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 43YsJG3vJbzDqSC for <patchwork@lists.ozlabs.org>; Tue, 8 Jan 2019 23:38:53 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AeWCu/n4YVD6/gGLG6vK2WC7xTdmP93XoCMBkGVlb+s=; b=a4dKYVsHIiAbFZTuIL+nqzKMJLzUJOtOhfibRDYWPBRYq/9/j/G8GR9v8LEIZ+eiR6vXvBBXwlbAf/ho5iV22NbqwfXBsVayrNOS6Kx/zuq7Z1Qnhvw81G0GXVJZlXhk3eJD7bFHqHWx7EQplvMDXrSVa1MVSWsc/ebg9P8yGnQ= Received: from VI1PR05MB4269.eurprd05.prod.outlook.com (52.133.12.22) by VI1PR05MB5869.eurprd05.prod.outlook.com (20.178.125.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 12:38:45 +0000 Received: from VI1PR05MB4269.eurprd05.prod.outlook.com ([fe80::39c0:bdf5:cba0:8f14]) by VI1PR05MB4269.eurprd05.prod.outlook.com ([fe80::39c0:bdf5:cba0:8f14%5]) with mapi id 15.20.1495.011; Tue, 8 Jan 2019 12:38:45 +0000 From: Ali Alnubani <alialnu@mellanox.com> To: "patchwork@lists.ozlabs.org" <patchwork@lists.ozlabs.org> Subject: [PATCH] Fix return code when getting patch information fails Thread-Topic: [PATCH] Fix return code when getting patch information fails Thread-Index: AQHUp08YxwOEwvanUU+shR5/PBHSOw== Date: Tue, 8 Jan 2019 12:38:45 +0000 Message-ID: <20190108123834.2225-1-alialnu@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.11.0 x-clientproxiedby: LO2P265CA0316.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::16) To VI1PR05MB4269.eurprd05.prod.outlook.com (2603:10a6:803:40::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=alialnu@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2001:4b98:dc0:51:216:3eff:feac:53b] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB5869; 6:q/sw25QIyzSQmcobBKRusHbZE/EPYUbUkZxukDA1Tg/Zopl1T+DI1EWVwMsiOsFnZkScH5PibGacfz8pTQyuv7l08R1LswIrBb6TCL9K5Eaq3IqyMHFKaIspXc4hHngWRFGyQiHmKGdkvFvVJGjqeGoiHwrUjCDzsdZ2taV7qh5MBtGVnZNRNM/oOJ4vNcjqJor8pbM3P8YqyU1VHm4ZSye8E7i33YcOQEUsLlt12BWuNFGbOHhlqI7+opr7fi7ldpfSt68/0KFtUrsarzHbk4nJcCzDNNM2t1jfPjnp9gYBcf1VQ1Lwv8u32Df3D9U3jBalnzechsQRFBsKV7SQ+M0LWolL5UP9ruPY5+sLwbPWf7zWrrbQy/oFSQOLm8bwEyw4JvxI1yG10L6y/yC2ALigp1lHwJ+h1cuF2VEpxVjsJaeQ9YVtNyNxyY2V21nv3mbbpaKYJ/PCgRXateunvQ==; 5:bC7B6+qPLJViOAAV19L+1V3leiXbTDgRNFjvNzVZnMaerP/iFcdeHUdBsutsXr1/zuAs+ijgXdxLP05amkFlO2eQa84eIoZpA4GikOJFKTVnoq8tS08jyRflHGG0tI6enpG7gUmboFL/YLsVZbi9akhahnYcFp1NlF6LFvh8gQYcOusDUBRt3lfz5fzO1eLblEqejaO64LCOcJHyNmeyoQ==; 7:6+kAJGSgTjp92MJJfP5mMstTm7NBelxNfrZwNfjUhaOuQskyUnl2Q6S2n9kWBnLFpa1nEHWq0WnI/4+ZKzsz8ecugBSIBEpK/iXIg6MRJji7j26BqmfJHd3scR6icbrtGsH1T8Rq4sznKEGvc7sA4A== x-ms-office365-filtering-correlation-id: 269aae87-5960-4df7-93f8-08d675663a99 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB5869; x-ms-traffictypediagnostic: VI1PR05MB5869: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: <VI1PR05MB58694088313B5C78F6310556D78A0@VI1PR05MB5869.eurprd05.prod.outlook.com> x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(3231475)(944501520)(52105112)(93006095)(93001095)(10201501046)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:VI1PR05MB5869; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB5869; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(366004)(396003)(376002)(39860400002)(199004)(189003)(5660300001)(6512007)(6916009)(4326008)(305945005)(476003)(5640700003)(86362001)(46003)(6436002)(2616005)(50226002)(6486002)(1730700003)(81156014)(81166006)(8676002)(486006)(8936002)(1076003)(68736007)(25786009)(97736004)(2906002)(106356001)(2351001)(105586002)(6506007)(386003)(186003)(102836004)(256004)(52116002)(2501003)(14454004)(71190400001)(71200400001)(478600001)(99286004)(316002)(6116002)(53936002)(7736002)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5869; H:VI1PR05MB4269.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:3; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 9cmspaklBtOvIbwK11alFLMSrD7/eOaFanlDeQogUErBKbZ+ur+FWzzElY49S0pQ6iK1YzCxUEprH/34azBtqJNmABFpUOBop3uTacsO6zN9J7k+KY240Yl8Zjj/vCex0+bdYUfe1R8vx0jTbMiPMzFaBqB5AYhICb4P1C9hlQQV6JG6xNLj/6HzfDzWvlNJDztHTwppKRENcHpPPC428HFqinT0hrj9F4Y7IP3zqZign2AuAsak9tTDg6axQ51/Yjslcbb4djizqY/Dk/n+545UwqB4NPBMTrKn3zxos7agrbViUUM8vzpv4ND/8Jmc spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 269aae87-5960-4df7-93f8-08d675663a99 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 12:38:44.8390 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5869 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development <patchwork.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/patchwork>, <mailto:patchwork-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/patchwork/> List-Post: <mailto:patchwork@lists.ozlabs.org> List-Help: <mailto:patchwork-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/patchwork>, <mailto:patchwork-request@lists.ozlabs.org?subject=subscribe> Cc: Thomas Monjalon <thomas@monjalon.net> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" <patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> |
Series |
Fix return code when getting patch information fails
|
expand
|
On Tue, 2019-01-08 at 12:38 +0000, Ali Alnubani wrote: > The `info` command always exits with success, even if > the patch didn't exist. > Modified to exit with a non-zero exit status and > print an error message in that case. > > Signed-off-by: Ali Alnubani <alialnu@mellanox.com> Thanks, Ali, and sorry for the delayed response. This is applied now. Keep up the good work :) Stephen
diff --git a/pwclient/shell.py b/pwclient/shell.py index 2cff3a3..43c7a37 100644 --- a/pwclient/shell.py +++ b/pwclient/shell.py @@ -275,6 +275,12 @@ def action_states(rpc): def action_info(rpc, patch_id): patch = rpc.patch_get(patch_id) + + if patch == {}: + sys.stderr.write("Error getting information on patch ID %d\n" % + patch_id) + sys.exit(1) + s = "Information for patch id %d" % (patch_id) print(s) print('-' * len(s))
The `info` command always exits with success, even if the patch didn't exist. Modified to exit with a non-zero exit status and print an error message in that case. Signed-off-by: Ali Alnubani <alialnu@mellanox.com> --- pwclient/shell.py | 6 ++++++ 1 file changed, 6 insertions(+)