From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.4409.1591661888124247352 for ; Mon, 08 Jun 2020 17:18:08 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: nathaniel.l.desimone@intel.com) IronPort-SDR: b3lvL0Kh2fdFSgTXIdXW2eaLIOtzll6JP1biPrgmbYzbCVU/UHkRQOpiyPDiyP3pWyJgydYIVB YIsdiDgXi77g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2020 17:18:06 -0700 IronPort-SDR: Z1NUO2LOmkb/4KLUSOxvN1e21WuMl0/2Hyq4iDZJm95pr1GHrC4NdDkwqx++OTZGRELJyr/hvw LJVfsRTnX7Lg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,489,1583222400"; d="scan'208";a="472785095" Received: from nldesimo-desk1.amr.corp.intel.com ([10.251.138.67]) by fmsmga006.fm.intel.com with ESMTP; 08 Jun 2020 17:18:06 -0700 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Ashley E Desimone , Puja Pandya , Bret Barkelew , Prince Agyeman , Erik Bjorge Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Fix argument checks in manifest-repos Date: Mon, 8 Jun 2020 17:17:58 -0700 Message-Id: <20200609001758.2538-1-nathaniel.l.desimone@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fixed a logic bug in the argument checking for the manifest-repos command. Signed-off-by: Nate DeSimone Cc: Ashley E Desimone Cc: Puja Pandya Cc: Bret Barkelew Cc: Prince Agyeman Cc: Erik Bjorge --- edkrepo/commands/humble/manifest_repos_humble.py | 2 +- edkrepo/commands/manifest_repos_command.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/edkrepo/commands/humble/manifest_repos_humble.py b/edkrepo/commands/humble/manifest_repos_humble.py index 7dc8bfe..4a886a4 100644 --- a/edkrepo/commands/humble/manifest_repos_humble.py +++ b/edkrepo/commands/humble/manifest_repos_humble.py @@ -14,7 +14,7 @@ Contains user visible strings printed by the manifest_repos command. CFG_LIST_ENTRY = 'Config File: edkrepo.cfg Manifest Repository Name: {}' USER_CFG_LIST_ENTRY = 'Config File: edkrepo_user.cfg Manifest Repository Name: {}' NAME_REQUIRED = 'The "name" argument is required to add/remove a manifest repository' -ADD_REQUIRED = 'The "name", "url", "branch" and "local-path" arguments are required to add a manifest repository' +ADD_REQUIRED = 'The "name", "url", "branch" and "path" arguments are required to add a manifest repository' CANNOT_REMOVE_CFG = 'Manifest repositories cannot be removed from the edkrepo.cfg file.' REMOVE_NOT_EXIST = 'The selected manifest repository does note exist in the edkrepo_user.cfg file.' ALREADY_EXISTS = 'A manifest repository already exists with name: {}' diff --git a/edkrepo/commands/manifest_repos_command.py b/edkrepo/commands/manifest_repos_command.py index b817662..af79f19 100644 --- a/edkrepo/commands/manifest_repos_command.py +++ b/edkrepo/commands/manifest_repos_command.py @@ -80,7 +80,7 @@ class ManifestRepos(EdkrepoCommand): elif (args.action == ('add' or 'remove')) and not args.name: raise EdkrepoInvalidParametersException(humble.NAME_REQUIRED) - elif args.action == 'add' and not (args.branch or args.url or args.local_path): + elif args.action == 'add' and (not args.branch or not args.url or not args.path): raise EdkrepoInvalidParametersException(humble.ADD_REQUIRED) elif args.action == 'remove' and args.name and args.name in cfg_repos: raise EdkrepoInvalidParametersException(humble.CANNOT_REMOVE_CFG) -- 2.26.2.windows.1