From: Tony Mack Date: Tue, 9 Jun 2009 22:18:41 +0000 (+0000) Subject: define Config.config_path which stores the path to the directory where the config... X-Git-Tag: sfa-0.9-0@14641~321 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=39d5f4aec6848b2568c69b2c76f554ed3920741c;p=sfa.git define Config.config_path which stores the path to the directory where the config file lives --- diff --git a/geni/util/config.py b/geni/util/config.py index 4a94f5b3..9f9e018b 100644 --- a/geni/util/config.py +++ b/geni/util/config.py @@ -30,9 +30,12 @@ class Config: # Load plc_config loaded = False + # path to config.py source path = dirname(abspath(__file__)) self.path = path + # parent directory of config.py source self.basepath = dirname(self.path) + # path to actual config file filename = basename(filepath) alt_file = join(self.path, 'util', filename) geni_file = join(geni, 'util', filename) @@ -43,6 +46,7 @@ class Config: execfile(config_file, self.__dict__) loaded = True self.config_file = config_file + self.config_path = dirname(config_file) break except: pass