setup __cdist_base_dir

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-10-07 13:50:37 +02:00
parent ed347ffb8a
commit 1b484e2d87

View file

@ -46,6 +46,7 @@ class Context:
else: else:
self.base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) self.base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
# Input directories # Input directories
self.cache_dir = os.path.join(self.base_dir, "cache", target_host) self.cache_dir = os.path.join(self.base_dir, "cache", target_host)
self.conf_dir = os.path.join(self.base_dir, "conf") self.conf_dir = os.path.join(self.base_dir, "conf")
@ -86,6 +87,8 @@ class Context:
# Create directories # Create directories
self.__init_out_dirs() self.__init_out_dirs()
self.__init_env()
def cleanup(self): def cleanup(self):
# Do not use in __del__: # Do not use in __del__:
# http://docs.python.org/reference/datamodel.html#customization # http://docs.python.org/reference/datamodel.html#customization
@ -101,6 +104,7 @@ class Context:
def __init_env(self): def __init_env(self):
"""Setup environment""" """Setup environment"""
os.environ['__cdist_out_dir'] = self.out_dir os.environ['__cdist_out_dir'] = self.out_dir
os.environ['__cdist_base_dir'] = self.base_dir
def __init_out_dirs(self): def __init_out_dirs(self):
"""Initialise output directory structure""" """Initialise output directory structure"""