From d4321fb447a2804dfdf01f89eb5289a35d20b39c Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 10 Jun 2009 01:01:18 +0000 Subject: [PATCH] cleanup config path-search - might be harsh --- geni/util/config.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/geni/util/config.py b/geni/util/config.py index 9f9e018b..f9095944 100644 --- a/geni/util/config.py +++ b/geni/util/config.py @@ -18,7 +18,12 @@ from os.path import join,dirname,basename,abspath from geni.util.debug import log import traceback -geni = join(dirname(dirname(dirname(abspath(__file__)))), "geni") +# xxx the path-search part could use a cleanup; +# why would anyone want to store the config in /usr/share/geniwrapper at all ? +# also, if users want to use this, it might help to store stuff in ~/.sfirc or something + +# this would denote "/usr/share/geniwrapper/geni" +# geni = join(dirname(dirname(dirname(abspath(__file__)))), "geni") class Config: """ @@ -30,16 +35,19 @@ class Config: # Load plc_config loaded = False - # path to config.py source + # path to config.py source - this would be '/usr/share/geniwrapper/geni/util' path = dirname(abspath(__file__)) - self.path = path + # self.path not used from the outside + #self.path = path # parent directory of config.py source - self.basepath = dirname(self.path) + self.basepath = dirname(path) # path to actual config file filename = basename(filepath) - alt_file = join(self.path, 'util', filename) - geni_file = join(geni, 'util', filename) - files = [filepath, alt_file, geni_file] + # my guess is that alt_file and geni_file are identical + alt_file = join(path, 'util', filename) + # geni_file = join(geni, 'util', filename) + #files = [filepath, alt_file, geni_file] + files = [filepath, alt_file] for config_file in files: try: -- 2.43.0