From nobody Wed May 8 14:58:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60915+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60915+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591653158; cv=none; d=zohomail.com; s=zohoarc; b=mvRNYKqeW+hoMQ6OICuDik7AzB5c34UeLCpcXe9vLJp/cKPvYMEe4F2mltuK/Hi+i41OCxQ59qa/wseW886fLD8nGx1U/YZs9v7FHwbzXT6D4GbtlATtX76wJC06Tv2jsAf+A+7WNouMQO4mTBMnfuS5FDIZYmcPWxBLA5V/G5Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591653158; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=h72eJ8CAoJQJMfYtedn9xDjWgVau/uu5nLAtQtnFYQY=; b=mEKmxb4O49jiCjyG1atUFrtZYl2UI1E0S5FI/d0rn/6VS2kZixG2vZf6sdNnwD3V6RTr0ppmJrBOfVN0JmiqSqF4A772v03sCxjrTBHR/ojhp1q+ItYlPOMeK6ZDzzJseyv0NFvynaR9EymEWulF/GOwgz2NOEbHl70zb+aidcM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60915+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591653158291896.1953779531254; Mon, 8 Jun 2020 14:52:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rvj4YY1788612xO1jGcdQrCd; Mon, 08 Jun 2020 14:52:37 -0700 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.1618.1591653157102604273 for ; Mon, 08 Jun 2020 14:52:37 -0700 IronPort-SDR: /w/0g8R8YmLXUKe4oW6T5vJjRr3TZEtPia1HCy+Jkkono2v2avDRKNU/lMyFPvMbZW9UgjJ8xp qbMo+YeEWmMA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2020 14:52:36 -0700 IronPort-SDR: vXrMQZ44FeWzN93sDsLDa/kHnNrZunN9JT58vqaVVUtnJsYfN2O5F7nBwG5PRYIIB6RYjJ8fCO NpmJXHk88Mow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,489,1583222400"; d="scan'208";a="306073078" X-Received: from ekmann-mobl.amr.corp.intel.com (HELO nldesimo-DESK1.amr.corp.intel.com) ([10.251.138.67]) by orsmga008.jf.intel.com with ESMTP; 08 Jun 2020 14:52:35 -0700 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Ashley E Desimone , Puja Pandya , Bret Barkelew , Prince Agyeman , Erik Bjorge Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: check for manifest-repos section in edkrepo_user.cfg Date: Mon, 8 Jun 2020 14:52:14 -0700 Message-Id: <20200608215214.2296-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nathaniel.l.desimone@intel.com X-Gm-Message-State: BMhHjmX26nbGqLvRvlCo2dX2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591653157; bh=QKvKT/q66pFbSGQTr8aUCgXIG2YzujwQBKNepzBrZe8=; h=Cc:Date:From:Reply-To:Subject:To; b=oSPTFjxKt5YkdTQ58WMfHMW8nWQT1oHqvu0KdJtCO8/VqarzInR/xpXMarCThdxK6ey eEmXv3ArDAlNwnd4Ej4UWlthmq6dojH3WtSGaRReXdMtGdk2IiRRuHlLG7wK9N9vFKo+N m4wM9eX/W+Mm9wZhuplnEnjCZjUzgGvW0yY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The manifest-repos command currently does not check for the existance of the '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 Reviewed-by: Ashley DeSimone Reviewed-by: 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=3DT= rue) 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.nam= e): + user_cfg_file.remove_option('manifest-repos', args= .name) + else: + raise EdkrepoInvalidParametersException(humble.REM= OVE_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 EdkrepoInvalidParametersException(humble.REMOVE_= NOT_EXIST) with open(user_cfg_file_path, 'w') as cfg_stream: user_cfg_file.write(cfg_stream) --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60915): https://edk2.groups.io/g/devel/message/60915 Mute This Topic: https://groups.io/mt/74762422/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-