type emulator begins to run

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-26 11:21:04 +02:00
parent 6d75016139
commit 74dc5b96cb
2 changed files with 6 additions and 3 deletions

View file

@ -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")

View file

@ -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"]