From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 99CDBA0032; Sat, 17 Sep 2022 06:51:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7356D4021F; Sat, 17 Sep 2022 06:51:11 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id A43164021D for ; Sat, 17 Sep 2022 06:51:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663390269; x=1694926269; h=from:to:cc:subject:date:message-id; bh=7Np/qkjTyFicgx6dAq7Wkvm0S7o4B8aO3onISom3Hfs=; b=bTdSo12gVXAapCq+9cgMsLTGMThmr6Rn+1tpPYTvz3kEvK7wKCbwlIvq fFB+B6m94uDPAtffIwd00v+pWg9OW949n+JMiOIXKUMEkJET0vBZuCbos TS4tE3zc69h5fsSgBeq4Jco5LlOIdf2bur2W3d+MUAqgU3lG9FB2otQOg qFNTWPouetsTh9uNZU+p26OjurzByM4WV4RE8Amkvh6LfgW80Tpk3u4/C tAT9W9jk0By4ynONxVphWNRByOPgaupuNn8WEurnNszjI6I3gzQtKeAaL LMQSD4Kdxf5vwCL8Vl9izst2nhFCwOVDv3lTWL71RFG7jHX7bmhCCPL3y w==; X-IronPort-AV: E=McAfee;i="6500,9779,10472"; a="279507370" X-IronPort-AV: E=Sophos;i="5.93,322,1654585200"; d="scan'208";a="279507370" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 21:51:08 -0700 X-IronPort-AV: E=Sophos;i="5.93,322,1654585200"; d="scan'208";a="680213723" Received: from unknown (HELO cvl_100g_103.icx.intel.com) ([10.239.252.93]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 21:51:07 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Subject: [dts][PATCH V1] framework/tester:optimize handing of import error Date: Sat, 17 Sep 2022 21:04:18 +0800 Message-Id: <20220917130418.1690-1-zhiminx.huang@intel.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org the scapy import module failed, it may not be ImportError. except to import class failed, the module may also fail to import. if the from module name does not exist, it's will report ModuleNotFoundError. so add ModuleNotFoundError error in judgement. Signed-off-by: Zhimin Huang --- framework/tester.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/tester.py b/framework/tester.py index 7414efea..9a228f14 100644 --- a/framework/tester.py +++ b/framework/tester.py @@ -87,7 +87,7 @@ class Tester(Crb): # import scapy moudle to scapy APP out = session.session.send_expect(get_scapy_module_impcmd(), ">>> ") - if "ImportError" in out: + if "ImportError" in out or "ModuleNotFoundError" in out: session.logger.warning(f"entering import error: {out}") return session -- 2.17.1