From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.1640.1587143913856446116 for ; Fri, 17 Apr 2020 10:18:34 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: ashley.e.desimone@intel.com) IronPort-SDR: NDFbkLlgHHvE5CuLifNRS3mE7ddCRq/2ObDmEH4jk7lqD8SQj7k2h/ceNmp9BcnLocVzfcX/Lm tTxlx9Tt9vLA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2020 10:18:33 -0700 IronPort-SDR: Vl8qpl3mJ2RfMRiRqEbaMkUBrl4U8OP1+Isd9JwZuzF6my5IV0LimPyRBNACy8sEBKMoeRDpG8 IFw252VksV8g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,395,1580803200"; d="scan'208";a="243070612" Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga007.jf.intel.com with ESMTP; 17 Apr 2020 10:18:32 -0700 From: "Ashley E Desimone" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya , Erik Bjorge , Bret Barkelew , Prince Agyeman Subject: [edk2-staging/EdkRepo] [PATCH v2 5/6] EdkRepo: Move edkrepo_global_data directory to BaseConfig Date: Fri, 17 Apr 2020 10:18:28 -0700 Message-Id: <20200417171829.23032-6-ashley.e.desimone@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20200417171829.23032-1-ashley.e.desimone@intel.com> References: <20200417171829.23032-1-ashley.e.desimone@intel.com> 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 Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- 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 1afa221..4ae06f6 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) @@ -132,8 +133,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), @@ -148,7 +148,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): @@ -165,7 +165,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): @@ -192,7 +192,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