From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7B1608036C for ; Thu, 16 Mar 2017 07:06:19 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP; 16 Mar 2017 07:06:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,172,1486454400"; d="scan'208";a="945048819" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 16 Mar 2017 07:06:16 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 16 Mar 2017 07:06:16 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 16 Mar 2017 07:06:16 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Thu, 16 Mar 2017 22:06:14 +0800 From: "Yao, Jiewen" To: "Thomaiyar, Richard Marian" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] IntelFsp2Pkg: Raise exception for invalid BSF option Thread-Index: AQHSnW4OPkdFoCzaXkqKxNEUMx8G8qGXggaQ Date: Thu, 16 Mar 2017 14:06:13 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A905ED9@shsmsx102.ccr.corp.intel.com> References: <20170315092423.13840-1-richard.marian.thomaiyar@intel.com> In-Reply-To: <20170315092423.13840-1-richard.marian.thomaiyar@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] IntelFsp2Pkg: Raise exception for invalid BSF option X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Mar 2017 14:06:20 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: jiewen.yao@Intel.com > -----Original Message----- > From: Thomaiyar, Richard Marian > Sent: Wednesday, March 15, 2017 5:24 PM > To: edk2-devel@lists.01.org > Cc: Ma, Maurice ; Yao, Jiewen ; > Thomaiyar, Richard Marian > Subject: [PATCH] IntelFsp2Pkg: Raise exception for invalid BSF option >=20 > Raise exception for invalid BSF option in GenCfgOpt.py >=20 > Cc: Maurice Ma > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Richard Thomaiyar > --- > IntelFsp2Pkg/Tools/GenCfgOpt.py | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py > b/IntelFsp2Pkg/Tools/GenCfgOpt.py > index d8038e9..6dc1b10 100644 > --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py > +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py > @@ -1,6 +1,6 @@ > ## @ GenCfgOpt.py > # > -# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
> +# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
> # This program and the accompanying materials are licensed and made avai= lable > under > # the terms and conditions of the BSD License that accompanies this > distribution. > # The full text of the license may be found at > @@ -1239,6 +1239,7 @@ EndList > return 0 >=20 > def WriteBsfStruct (self, BsfFd, Item): > + LogExpr =3D CLogicalExpression() > if Item['type'] =3D=3D "None": > Space =3D "gPlatformFspPkgTokenSpaceGuid" > else: > @@ -1260,6 +1261,9 @@ EndList > for Option in OptList: > Option =3D Option.strip() > (OpVal, OpStr) =3D Option.split(':') > + test =3D LogExpr.getNumber (OpVal) > + if test is None: > + raise Exception("Selection Index '%s' is not a > number" % OpVal) > TmpList.append((OpVal, OpStr)) > return TmpList >=20 > -- > 2.9.0.windows.1