From 74dc5b96cb3af00f8fb6ac3dd805f69de40d2737 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 26 Sep 2011 11:21:04 +0200 Subject: [PATCH] type emulator begins to run Signed-off-by: Nico Schottelius --- lib/cdist/emulator.py | 8 +++++--- lib/cdist/exec.py | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/cdist/emulator.py b/lib/cdist/emulator.py index 0e693dbe..ecdfff25 100755 --- a/lib/cdist/emulator.py +++ b/lib/cdist/emulator.py @@ -24,6 +24,8 @@ import logging import os import sys +import cdist.path + log = logging.getLogger(__name__) def emulator(argv): @@ -37,12 +39,12 @@ def emulator(argv): parser = argparse.ArgumentParser(add_help=False) # Setup optional parameters - for parameter in file_to_list(os.path.join(param_dir, "optional")): + for parameter in cdist.path.file_to_list(os.path.join(param_dir, "optional")): argument = "--" + parameter parser.add_argument(argument, action='store', required=False) # Setup required parameters - for parameter in file_to_list(os.path.join(param_dir, "required")): + for parameter in cdist.path.file_to_list(os.path.join(param_dir, "required")): argument = "--" + parameter parser.add_argument(argument, action='store', required=True) @@ -69,7 +71,7 @@ def emulator(argv): log.debug(args) object_dir = os.path.join(global_dir, "object", type, - object_id, DOT_CDIST) + object_id, cdist.path.DOT_CDIST) param_out_dir = os.path.join(object_dir, "parameter") object_source_file = os.path.join(object_dir, "source") diff --git a/lib/cdist/exec.py b/lib/cdist/exec.py index 4b61a097..09e4e8a4 100644 --- a/lib/cdist/exec.py +++ b/lib/cdist/exec.py @@ -29,6 +29,7 @@ def shell_run_or_debug_fail(script, *args, **kargs): # and sh -c -e does not exit if /bin/false called args[0][:0] = [ "/bin/sh", "-e" ] + remote = False if "remote_prefix" in kargs: remote = True args[0][:0] = kargs["remote_prefix"]