move explorer out dir creation into Explorer class
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
d95d195b40
commit
b7824c3ead
2 changed files with 8 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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"""
|
||||
|
|
Loading…
Reference in a new issue