From dbbbf822fe55f714c115fa4e610b62361dfd614e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 8 Sep 2011 15:52:34 +0200 Subject: [PATCH] make cdist-type-emulator work Signed-off-by: Nico Schottelius --- bin/cdist | 15 ++++++++++++--- bin/cdist-deploy-to | 1 - 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bin/cdist b/bin/cdist index 0cc4ac7f..57df474d 100755 --- a/bin/cdist +++ b/bin/cdist @@ -169,7 +169,7 @@ class Cdist: log.debug("Linking %s to %s", source, destination) os.symlink(source, destination) - def global_explore(self): + def run_global_explores(self): """Run global explorers""" explorers = self.list_global_explorers() if(len(explorers) == 0): @@ -186,6 +186,7 @@ class Cdist: self.remote_run_or_fail(cmd, stdout=output_fd) output_fd.close() + # def run_type_explorer(self): def init_deploy(self): log.info("Creating clean directory structure") @@ -203,9 +204,17 @@ class Cdist: """Run the initial manifest""" log.info("Running the initial manifest") env = os.environ.copy() - env['__target_host'] = self.target_host env['PATH'] = self.bin_dir + ":" + env['PATH'] + env['__target_host'] = self.target_host + env['__global'] = self.out_dir + + # Legacy stuff to make cdist-type-emulator work + env['__cdist_conf_dir'] = CONF_DIR + env['__cdist_core_dir'] = os.path.join(BASE_DIR, "core") + env['__cdist_local_base_dir'] = self.temp_dir + env['__cdist_manifest'] = self.initial_manifest + self.shell_run_or_debug_fail(self.initial_manifest, [self.initial_manifest], env=env) @@ -215,7 +224,7 @@ class Cdist: """Mimic the old deploy to: Deploy to one host""" log.info("Deploying to host " + self.target_host) self.init_deploy() - self.global_explore() + self.run_global_explores() self.run_initial_manifest() diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 79f42931..96650f90 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -43,7 +43,6 @@ __cdist_echo info "cdist $__cdist_version: Configuring $__cdist_target_host " # See cdist-stages(7) # -cdist-manifest-run-init "$__cdist_target_host" cdist-object-all "$__cdist_target_host" cdist-object-prepare cdist-object-all "$__cdist_target_host" cdist-object-run cdist-cache "$__cdist_target_host"