type emulator begins to run
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
6d75016139
commit
74dc5b96cb
2 changed files with 6 additions and 3 deletions
|
@ -24,6 +24,8 @@ import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import cdist.path
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
def emulator(argv):
|
def emulator(argv):
|
||||||
|
@ -37,12 +39,12 @@ def emulator(argv):
|
||||||
parser = argparse.ArgumentParser(add_help=False)
|
parser = argparse.ArgumentParser(add_help=False)
|
||||||
|
|
||||||
# Setup optional parameters
|
# 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
|
argument = "--" + parameter
|
||||||
parser.add_argument(argument, action='store', required=False)
|
parser.add_argument(argument, action='store', required=False)
|
||||||
|
|
||||||
# Setup required parameters
|
# 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
|
argument = "--" + parameter
|
||||||
parser.add_argument(argument, action='store', required=True)
|
parser.add_argument(argument, action='store', required=True)
|
||||||
|
|
||||||
|
@ -69,7 +71,7 @@ def emulator(argv):
|
||||||
log.debug(args)
|
log.debug(args)
|
||||||
|
|
||||||
object_dir = os.path.join(global_dir, "object", type,
|
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")
|
param_out_dir = os.path.join(object_dir, "parameter")
|
||||||
|
|
||||||
object_source_file = os.path.join(object_dir, "source")
|
object_source_file = os.path.join(object_dir, "source")
|
||||||
|
|
|
@ -29,6 +29,7 @@ def shell_run_or_debug_fail(script, *args, **kargs):
|
||||||
# and sh -c -e does not exit if /bin/false called
|
# and sh -c -e does not exit if /bin/false called
|
||||||
args[0][:0] = [ "/bin/sh", "-e" ]
|
args[0][:0] = [ "/bin/sh", "-e" ]
|
||||||
|
|
||||||
|
remote = False
|
||||||
if "remote_prefix" in kargs:
|
if "remote_prefix" in kargs:
|
||||||
remote = True
|
remote = True
|
||||||
args[0][:0] = kargs["remote_prefix"]
|
args[0][:0] = kargs["remote_prefix"]
|
||||||
|
|
Loading…
Reference in a new issue