public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Bjorge, Erik C" <erik.c.bjorge@intel.com>
To: "Desimone, Ashley E" <ashley.e.desimone@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com>,
	"Pandya, Puja" <puja.pandya@intel.com>,
	Bret Barkelew <Bret.Barkelew@microsoft.com>,
	"Agyeman, Prince" <prince.agyeman@intel.com>
Subject: Re: [edk2-staging/EdkRepo] [PATCH 5/6] EdkRepo: Move edkrepo_global_data directory to BaseConfig
Date: Fri, 17 Apr 2020 15:19:58 +0000	[thread overview]
Message-ID: <MW3PR11MB4554E18DD5877517F470F63FAED90@MW3PR11MB4554.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200417033123.34972-6-ashley.e.desimone@intel.com>

Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>

-----Original Message-----
From: Desimone, Ashley E <ashley.e.desimone@intel.com> 
Sent: Thursday, April 16, 2020 8:31 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Agyeman, Prince <prince.agyeman@intel.com>
Subject: [edk2-staging/EdkRepo] [PATCH 5/6] EdkRepo: Move edkrepo_global_data directory to BaseConfig

Move the edkrepo_global_data_directory from the GlobalConfig class to the base config class.

Updated the assignments of self.filename in both the GlobalConfig and the GlobalUserConfig classes as well as the initializaion of the BaseConfig class to use get_edkrepo_global_data_directory()

Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
---
 edkrepo/config/config_factory.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/edkrepo/config/config_factory.py b/edkrepo/config/config_factory.py
index e053f8b..a4daba3 100644
--- a/edkrepo/config/config_factory.py
+++ b/edkrepo/config/config_factory.py
@@ -77,10 +77,11 @@ class BaseConfig():
     for the class.  Property generation and verification is based off of a list of CfgProp classes.
     """
     prop_list = []
-    def __init__(self, filename, read_only=True):
+    def __init__(self, filename, global_data_dir, read_only=True):
         # Do basic initialization of private variables
         self.read_only = read_only
         self.filename = filename
+        self.global_data_dir = global_data_dir
         self.cfg = configparser.ConfigParser(allow_no_value=True, delimiters='=')
         if os.path.isfile(self.filename):
             self.cfg.read(self.filename) @@ -136,8 +137,7 @@ class GlobalConfig(BaseConfig):
     edkrepo installer.
     """
     def __init__(self):
-        self.edkrepo_global_data_directory = get_edkrepo_global_data_directory()
-        self.filename = os.path.join(self.edkrepo_global_data_directory, "edkrepo.cfg")
+        self.filename = 
+ os.path.join(get_edkrepo_global_data_directory(), "edkrepo.cfg")
         self.prop_list = [
                 CfgProp('manifest-repo', 'URL', 'manifest_repo_url', None, True),
                 CfgProp('manifest-repo', 'Branch', 'manifest_repo_branch', None, True), @@ -152,7 +152,7 @@ class GlobalConfig(BaseConfig):
                 CfgProp('preferred-entry-point', 'entry-point', 'pref_entry_point', None, True)]
         if not os.path.isfile(self.filename):
             raise EdkrepoGlobalConfigNotFoundException(humble.GLOBAL_CFG_NOT_FOUND.format(self.filename))
-        super().__init__(self.filename, True)
+        super().__init__(self.filename, 
+ get_edkrepo_global_data_directory(), True)
 
     @property
     def preferred_entry(self):
@@ -169,7 +169,7 @@ class GlobalConfig(BaseConfig):
     @property
     def manifest_repo_abs_local_path(self):
         """Provides an absolute path to the manifest repo based on configuration file values."""
-        return os.path.join(self.edkrepo_global_data_directory, self.manifest_repo_local_path)
+        return os.path.join(self.global_data_dir, 
+ self.manifest_repo_local_path)
 
     @property
     def sparsecheckout_data(self):
@@ -196,7 +196,7 @@ class GlobalUserConfig(BaseConfig):
             CfgProp('scm', 'mirror_geo', 'geo', 'none', False),
             CfgProp('send-review', 'max-patch-set', 'max_patch_set', '10', False)
             ]
-        super().__init__(self.filename, False)
+        super().__init__(self.filename, 
+ get_edkrepo_global_data_directory(), False)
 
     @property
     def max_patch_set_int(self):
--
2.16.2.windows.1


  reply	other threads:[~2020-04-17 15:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17  3:31 [edk2-staging/EdkRepo] [PATCH 0/6] EdkRepo: Add Initial Config Factory Support for Multiple Manifest Repositories Ashley E Desimone
2020-04-17  3:31 ` [edk2-staging/EdkRepo] [PATCH 1/6] EdkRepo: Support Updated CFG Format Defining Multiple Manifest Repos Ashley E Desimone
2020-04-17 15:21   ` Bjorge, Erik C
2020-04-17  3:31 ` [edk2-staging/EdkRepo] [PATCH 2/6] EdkRepo: Add new sections to edkrepo.cfg Ashley E Desimone
2020-04-17 15:04   ` Bjorge, Erik C
2020-04-17  3:31 ` [edk2-staging/EdkRepo] [PATCH 3/6] EdkRepo: Add the manifest_repo_list property to BaseConfig Ashley E Desimone
2020-04-17 15:22   ` Bjorge, Erik C
2020-04-17  3:31 ` [edk2-staging/EdkRepo] [PATCH 4/6] EdkRepo: Add manifest_repo_props() Ashley E Desimone
2020-04-17 15:08   ` Bjorge, Erik C
2020-04-17 17:04     ` Ashley E Desimone
2020-04-17  3:31 ` [edk2-staging/EdkRepo] [PATCH 5/6] EdkRepo: Move edkrepo_global_data directory to BaseConfig Ashley E Desimone
2020-04-17 15:19   ` Bjorge, Erik C [this message]
2020-04-17  3:31 ` [edk2-staging/EdkRepo] [PATCH 6/6] EdkRepo: Add 'get' functions for Manifest Repo data Ashley E Desimone
2020-04-17 15:23   ` Bjorge, Erik C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW3PR11MB4554E18DD5877517F470F63FAED90@MW3PR11MB4554.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox