# Node ID 2f0c73f339355ec0968cbd50c28fb94848e3890f # Parent 32f058ce294a2d101565c176af7e6bfff4a14a33 diff --git a/configs/common/Options.py b/configs/common/Options.py --- a/configs/common/Options.py +++ b/configs/common/Options.py @@ -234,6 +234,9 @@ parser.add_option("-o", "--options", default="", help="""The options to pass to the binary, use " " around the entire string""") + parser.add_option("-e", "--env", default="", + help="Copy environment variables from text file into"\ + "workload stack.") parser.add_option("-i", "--input", default="", help="Read stdin from a file.") parser.add_option("--output", default="", diff --git a/configs/example/se.py b/configs/example/se.py --- a/configs/example/se.py +++ b/configs/example/se.py @@ -94,6 +94,11 @@ process.executable = wrkld process.cwd = os.getcwd() + if options.env: + with open(options.env, 'r') as f: + d = dict([line.rstrip().split('=', 1) for line in f]) + process.env = [k + "=" + v for (k,v) in d.items()] + if len(pargs) > idx: process.cmd = [wrkld] + pargs[idx].split() else: