setup __cdist_base_dir
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
ed347ffb8a
commit
1b484e2d87
1 changed files with 5 additions and 1 deletions
|
@ -45,6 +45,7 @@ class Context:
|
||||||
self.base_dir = os.environ['__cdist_base_dir']
|
self.base_dir = os.environ['__cdist_base_dir']
|
||||||
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)
|
||||||
|
@ -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
|
||||||
|
@ -100,7 +103,8 @@ 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"""
|
||||||
|
|
Loading…
Reference in a new issue