From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com []) by mx.groups.io with SMTP id smtpd.web10.1142.1591743861278530599 for ; Tue, 09 Jun 2020 16:04:29 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: erik.c.bjorge@intel.com) IronPort-SDR: sWUlMR8/MjWVIZPxJ2vY8YMLUDMLXtKmXuhLOmpz1QlS4wq3o/Wr0VxULvE/LaRONcuMDqnlr/ +VaJfbCgGl2Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2020 16:04:29 -0700 IronPort-SDR: 2lfX/iKXwB7pJIOFueV68OqAc+fRNxqfQWzfHvmUYoGzvyZtG8YITQ65omBvkQDISHsTCnI2iH 9tEkLUOaVySg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,493,1583222400"; d="scan'208";a="473223598" Received: from sfp-ecbjorge.amr.corp.intel.com ([10.165.41.176]) by fmsmga005.fm.intel.com with ESMTP; 09 Jun 2020 16:04:29 -0700 From: "Bjorge, Erik C" To: devel@edk2.groups.io Cc: Ashley E Desimone , Nate DeSimone , Puja Pandya , Bret Barkelew , Prince Agyeman Subject: [edk2-staging/EdkRepo] [PATCH v1 2/2] EdkRepo: Adding backwards compatibility for old pin files Date: Tue, 9 Jun 2020 16:04:06 -0700 Message-Id: <8f672799cb0b3471d68146a351ec20b441e34ce8.1591743203.git.erik.c.bjorge@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Older pin files used the invalid enable_submodule attribute. This has been fixed for new pin files but we need to be able to support older pin files as well. Cc: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Bret Barkelew Cc: Prince Agyeman Cc: Erik Bjorge Signed-off-by: Erik Bjorge --- edkrepo_manifest_parser/edk_manifest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/edkrepo_manifest_parser/edk_manifest.py b/edkrepo_manifest_parser/edk_manifest.py index adf6d52..00ad392 100644 --- a/edkrepo_manifest_parser/edk_manifest.py +++ b/edkrepo_manifest_parser/edk_manifest.py @@ -795,7 +795,11 @@ class _RepoSource(): # If enableSubmodule is not set to True then default to False self.enableSub = (element.attrib['enableSubmodule'].lower() == 'true') except Exception: - self.enableSub = False + try: + # Adding backwards compatibility with pin files that used incorrect attribute + self.enableSub = (element.attrib['enable_submodule'].lower() == 'true') + except Exception: + self.enableSub = False if self.branch is None and self.commit is None and self.tag is None: raise KeyError(ATTRIBUTE_MISSING_ERROR) -- 2.27.0.windows.1