From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.1689.1591653344296010018 for ; Mon, 08 Jun 2020 14:55:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=fpSzrdX9; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: erik.c.bjorge@intel.com) IronPort-SDR: rpPUMkRLegCCN9JncCOrh5BTXBUaWYxwKg41ozE+2y3vC8oCniF9OIdnIpXbpAo6+OXTh00fJl R1rpFp/aASgA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2020 14:55:44 -0700 IronPort-SDR: +BWBDA0CwHPNEqEwxLsthX2VhikIJ+ucqm6Curd34Pc9YjIF4wmMJ6y89ms4SeNU5uquwSMnUk n1Ip3EQ+aioQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,489,1583222400"; d="scan'208";a="306073649" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by orsmga008.jf.intel.com with ESMTP; 08 Jun 2020 14:55:43 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 8 Jun 2020 14:55:42 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 8 Jun 2020 14:55:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lCA4GThewb7uXTahyPXTElunZJkhKJ33pkTximLhZmessoV1bBzkjwRBOmFWm9zVUPsFTceYsxjTm5a4maWovcsbjpakQYORCf1EQTAuiaZXVO/iCnYh10mk0WU7JvMMcNsfqnZrJUSkAKHw94CQ1y6zcGjRcXjQ3VkT0UVvQpmbo5I56ASneRD+ditylvZGlWQwmg3RkNme/h5yZW/FpOfapPBHc8F4P7IYEKKPd5rOySRir+eGwVPtHhcPFsjPR3uXZKPwHu9s+xg/QZW2BpJHy33629TTgWRFbC5C4b6LHhVKD5vrckXKCb1wPFYPPqXKK/biaRSIs5XB/XYtqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LQEZ+qD9gSTyj8NQ9Ph7m4XOOPAk88QoQ5By5/ao3Cc=; b=RBC9BC1xQlN1WcAExzD2zVLtpLtNE+whap+mN/ESVrUkffjsPgCNwCOMHnlGKGG6N+zpyQYQ9AMFH2YDAzLw8CBUptaFYUIN1hl7N+NqYpPhs7BJIupT+VAO68lpipvQ5f9wY9Jf86FaWOaukXKSGo7Czkj90korHQo2Dnoll2iKMi8SXGQ0jA/aSzISVYZxo/85TT9LhOIl9tjeDoTjQdDuw49HyV3mPpDYbL7X0ZzMB1PTZoZ7ukAqWA2u4v4lbCEjnjIvo3kKOlOy/pnUB7rKuEbObBPgQ5K9m3B/EgmKJ0Zn1wOzF0ArR8GdkVN8zNnMpEHhPAoxOGFhdUdBLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LQEZ+qD9gSTyj8NQ9Ph7m4XOOPAk88QoQ5By5/ao3Cc=; b=fpSzrdX9cANuLNSjvVRypcnGllJE35V7uUf/wk05/2FJBkRxKSNKjoRop6mthReHh73lmHCI0h8w7xhLmFTxY8t1DIjfOhwWC3fp/mUJSctqDOM0dyb299oEwLQl/QTWOYf5OCehI0P9WiSeMTUVT9Hbc1xmCvLXkSf4RDB9aF4= Received: from MW3PR11MB4554.namprd11.prod.outlook.com (2603:10b6:303:5d::7) by MW3PR11MB4553.namprd11.prod.outlook.com (2603:10b6:303:2c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.20; Mon, 8 Jun 2020 21:55:40 +0000 Received: from MW3PR11MB4554.namprd11.prod.outlook.com ([fe80::c569:9903:4c10:9281]) by MW3PR11MB4554.namprd11.prod.outlook.com ([fe80::c569:9903:4c10:9281%4]) with mapi id 15.20.3066.023; Mon, 8 Jun 2020 21:55:40 +0000 From: "Bjorge, Erik C" To: "devel@edk2.groups.io" , "Desimone, Nathaniel L" CC: "Desimone, Ashley E" , "Pandya, Puja" , Bret Barkelew , "Agyeman, Prince" Subject: Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: check for manifest-repos section in edkrepo_user.cfg Thread-Topic: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: check for manifest-repos section in edkrepo_user.cfg Thread-Index: AQHWPd8jWfnKsHJETEGvwzXUv6X0yqjPQ0+A Date: Mon, 8 Jun 2020 21:55:40 +0000 Message-ID: References: <20200608215214.2296-1-nathaniel.l.desimone@intel.com> In-Reply-To: <20200608215214.2296-1-nathaniel.l.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [134.134.136.206] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a863a9db-6755-4094-ba12-08d80bf6af74 x-ms-traffictypediagnostic: MW3PR11MB4553: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 042857DBB5 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TRJ0kliN8xzkaGJNyPsCSPcfnbr6DTQwv9yoJ0cuMajf5MnQOQHc2VB8CfKzwDY9DcS4+b1qVsGk3xiQXpXi3VBuVMRN3nIqbCPRBNhLIuwE8uGjb/EezB3TF40GqYe06Nfv1Pw8kd9Twd6X+c2FKkWJq49YywRAaQRvJ0PEtDwsC4VkVBUHBPvFuKKeoHIdsW7WP1lzt3dU2T7+m5LM3Qb1qMh1qDVS6KgrgbvQH83urhZYw8jBDIN3Zcq5NtXhQD0G7YotOMnMZzJhhSS4HoGoZruCpzoS0mocTmVvVjnZ9ZYB2QUXNGsn4Ioukfvu/MCxei0oNgFlCt0N6bG6fos+Eq2nct9laVRlZ0x3EOjbO4NJIez6uTzbeJ00ccn3KJ7P/cUckRBgX7q6l/DPdA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR11MB4554.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(39860400002)(346002)(366004)(396003)(136003)(376002)(9686003)(55016002)(110136005)(478600001)(66556008)(64756008)(66446008)(71200400001)(54906003)(86362001)(26005)(966005)(66476007)(76116006)(66946007)(33656002)(5660300002)(8936002)(107886003)(316002)(6636002)(7696005)(2906002)(53546011)(83380400001)(52536014)(186003)(8676002)(4326008)(6506007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: KUqphnXqyn1NvgB6axhqor0sNzDftgN+tO07PM5jZ1QeFvClDxu+zOICpPVEPrmuub0yNOH8FDDusvOqqgER7ISAoWFWitD6qSSX8wFwzF+FRfNtCVY1b8+/eMvmpT8/Qvta0DCR5FLSDi+3ZriStUpWS1PpWT25XpSEkxJIvKfK8oj9p+UWUrY+fxzOkYrEzhsc2aQ5Ftq0JIhXE6ySUq2d92gZZMct7JuaInjjJHxj/QH5fmOwm07RCtErtloiMj8P3csjQEhmQ75AQb+53JYGFVfHX5dxTN+7QICls3jBhMPlMPdPnNnEwEJ1em1CrdfvKwo9/NC/d+peAoXs0Y10xNzx03C8c4crPsvB6KHLfi55p4sbsch/KvVRyBucPK/PHDiimRJWC9zyUxY3KSKQc0o0OmEIW/NEGzpyse53lL2q6pn/fd0jRXqyApt9Ktb2sr8iKtzzhQZDab+9OWXD5OQe4Hm/Gvq6RCD5N2TmCHTTyynGXra5v0nYzwQy MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a863a9db-6755-4094-ba12-08d80bf6af74 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2020 21:55:40.5492 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: KZUo/FrRnM7fyoPrGH68jLVPWB0In4ff36AV1bMSGccXWmakmcP36qhD44qPeGrQ8m55wQHZ/B31WCDhnkUeTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4553 Return-Path: erik.c.bjorge@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Erik Bjorge -----Original Message----- From: devel@edk2.groups.io On Behalf Of Nate DeSimo= ne Sent: Monday, June 8, 2020 2:52 PM To: devel@edk2.groups.io Cc: Desimone, Ashley E ; Pandya, Puja ; Bret Barkelew ; Agyeman, Pri= nce ; Bjorge, Erik C Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: check for ma= nifest-repos section in edkrepo_user.cfg The manifest-repos command currently does not check for the existance of t= he 'manifest-repos' section in the edkrepo_user.cfg file. This change adds = the check. Signed-off-by: Nate DeSimone Cc: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Bret Barkelew Cc: Prince Agyeman Cc: Erik Bjorge --- edkrepo/commands/manifest_repos_command.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/edkrepo/commands/manifest_repos_command.py b/edkrepo/commands= /manifest_repos_command.py index b817662..3dbe604 100644 --- a/edkrepo/commands/manifest_repos_command.py +++ b/edkrepo/commands/manifest_repos_command.py @@ -95,13 +95,24 @@ class ManifestRepos(EdkrepoCommand): user_cfg_file =3D configparser.ConfigParser(allow_no_value=3D= True) user_cfg_file.read(user_cfg_file_path) if args.action =3D=3D 'add': + if not user_cfg_file.has_section('manifest-repos'): + user_cfg_file.add_section('manifest-repos') user_cfg_file.set('manifest-repos', args.name, None) user_cfg_file.add_section(args.name) user_cfg_file.set(args.name, 'URL', args.url) user_cfg_file.set(args.name, 'Branch', args.branch) user_cfg_file.set(args.name, 'LocalPath', args.path) if args.action =3D=3D 'remove': - user_cfg_file.remove_option('manifest-repos', args.name) - user_cfg_file.remove_section(args.name) + if user_cfg_file.has_section('manifest-repos'): + if user_cfg_file.has_option('manifest-repos', args.na= me): + user_cfg_file.remove_option('manifest-repos', arg= s.name) + else: + raise EdkrepoInvalidParametersException(humble.RE= MOVE_NOT_EXIST) + else: + raise EdkrepoInvalidParametersException(humble.REMOVE= _NOT_EXIST) + if user_cfg_file.has_section(args.name): + user_cfg_file.remove_section(args.name) + else: + raise=20 + EdkrepoInvalidParametersException(humble.REMOVE_NOT_EXIST) with open(user_cfg_file_path, 'w') as cfg_stream: user_cfg_file.write(cfg_stream) -- 2.26.2.windows.1