From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D6AF1A04DD; Thu, 22 Oct 2020 03:18:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B560A69FD; Thu, 22 Oct 2020 03:18:26 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 76C88685C for ; Thu, 22 Oct 2020 03:18:23 +0200 (CEST) IronPort-SDR: sZrFrBzzfnS6yD4hbcpo/VWSRHHxld1HkZW8xdGCKA9GbHNcNUdsklp5Oe1i9cRoft274tuj9+ 46WaVtsRFUTQ== X-IronPort-AV: E=McAfee;i="6000,8403,9781"; a="146748020" X-IronPort-AV: E=Sophos;i="5.77,402,1596524400"; d="scan'208";a="146748020" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2020 18:18:21 -0700 IronPort-SDR: xOVkhAopiKA2j4NL1SbxEmmfeS0SkQ9dPtvvJbU2I/yykliKYC+LLHDOccWscBI02TwUgzEQBV lj2IJtN7ShXw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,402,1596524400"; d="scan'208";a="348543130" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga004.fm.intel.com with ESMTP; 21 Oct 2020 18:18:20 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 21 Oct 2020 18:18:19 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX601.ccr.corp.intel.com (10.109.6.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 22 Oct 2020 09:18:17 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Thu, 22 Oct 2020 09:18:17 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" , "Ma, LihongX" CC: "Mo, YufengX" Thread-Topic: [dts] [PATCH V2 1/3] framework: check the python version Thread-Index: AQHWofpj8GQrgFRv2UChXkExR3sgjKmi2tyQ Date: Thu, 22 Oct 2020 01:18:17 +0000 Message-ID: References: <20201014071448.32119-1-yufengx.mo@intel.com> <20201014071448.32119-2-yufengx.mo@intel.com> In-Reply-To: <20201014071448.32119-2-yufengx.mo@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V2 1/3] framework: check the python version X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "dts" DTS only support Python3 now, it doesn't support Python2. But it requires P= ython minus version. E.g. Python3.4 is not supported, it requires version = larger than 3.6x. > +def check_crb_python_version(crb): > + cmd =3D 'python3 -V' It seems you are telling python version for python 3. If you are using pyth= on3, how can it tell you python2. > + out =3D crb.send_expect(cmd, '#', 5) > + pat =3D "Python (\d+).(\d+).(\d+)" > + result =3D re.findall(pat, out) > + if not result or int(result[0][0]) < 3: > + crb.logger.warning( > + ("WARNING: Tester node python version is lower than python 3= , " > + "it is deprecated for use in DTS, " Python2 have been replaced by Python2 in DTS, so the message is not reasona= ble. > + "and will not work in future releases.")) > + crb.logger.warning("Please use Python 3 instead") > + > + > +def check_dts_python_version(): > + if sys.version_info.major < 3: > + print(RED( > + ("WARNING: Dts running node python version is lower than pyt= hon 3, " > + "it is deprecated for use in DTS, " > + "and will not work in future releases.")), file=3Dsys.stder= r) > + print(RED("Please use Python 3 instead"), file=3Dsys.stderr) > -- > 2.21.0