From 1b484e2d87111d0c44bdeb8e985d6f45937618bd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 7 Oct 2011 13:50:37 +0200 Subject: [PATCH] setup __cdist_base_dir Signed-off-by: Nico Schottelius --- lib/cdist/context.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cdist/context.py b/lib/cdist/context.py index 3ecd84e0..a503372f 100644 --- a/lib/cdist/context.py +++ b/lib/cdist/context.py @@ -45,6 +45,7 @@ class Context: self.base_dir = os.environ['__cdist_base_dir'] else: self.base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) + # Input directories self.cache_dir = os.path.join(self.base_dir, "cache", target_host) @@ -86,6 +87,8 @@ class Context: # Create directories self.__init_out_dirs() + self.__init_env() + def cleanup(self): # Do not use in __del__: # http://docs.python.org/reference/datamodel.html#customization @@ -100,7 +103,8 @@ class Context: def __init_env(self): """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): """Initialise output directory structure"""