diff --git a/lib/cdist/config_install.py b/lib/cdist/config_install.py index f9aeaf19..3c809331 100644 --- a/lib/cdist/config_install.py +++ b/lib/cdist/config_install.py @@ -73,7 +73,6 @@ class ConfigInstall(object): # FIXME: raise more beautiful exception / Steven: handle exception os.mkdir(self.context.out_path) - os.mkdir(self.global_explorer_out_path) os.mkdir(self.context.bin_path) # FIXME: remove this function, only expose ENV @@ -93,8 +92,7 @@ class ConfigInstall(object): def object_prepare(self, cdist_object): """Prepare object: Run type explorer + manifest""" log.debug("Preparing object: " + cdist_object.name) - cdist_object.explorers = - self.explorer.run_type_explorer(cdist_object) + cdist_object.explorers = self.explorer.run_type_explorer(cdist_object) self.manifest.run_type_manifest(cdist_object) cdist_object.prepared = True diff --git a/lib/cdist/explorer.py b/lib/cdist/explorer.py index b0db60bc..9030e506 100644 --- a/lib/cdist/explorer.py +++ b/lib/cdist/explorer.py @@ -22,16 +22,17 @@ import io import logging -#import os +import os #import stat #import shutil #import sys #import tempfile #import time # -#import cdist.core #import cdist.exec +import cdist + log = logging.getLogger(__name__) class Explorer: @@ -39,6 +40,10 @@ class Explorer: def __init__(self, context): self.context = context + try: + os.mkdir(self.context.global_explorer_out_path) + except OSError as e: + raise cdist.Error("Failed to create explorer out path: %s" % e) def run_type_explorer(self, cdist_object): """Run type specific explorers for objects"""