Set PATH in slaprunner wrapper

parent 81075127
......@@ -68,9 +68,11 @@ class Recipe(BaseSlapRecipe):
self.substituteTemplate(pkg_resources.resource_filename(__name__,
'template/slapos.cfg.in'), configuration))
self.path_list.append(config_file)
execute_arguments = dict(path = os.environ['PATH'],
args = [self.options['slaprunner'].strip(), config_file])
self.path_list.extend(zc.buildout.easy_install.scripts([('slaprunner',
'slapos.recipe.slaprunner.execute', 'execute')], self.ws, sys.executable,
self.wrapper_directory, arguments=[self.options['slaprunner'].strip(),
config_file]))
self.wrapper_directory, arguments=execute_arguments))
self.setConnectionDict(dict(url='http://[%s]:%s' % (ipv6, runner_port)))
return self.path_list
......@@ -3,4 +3,6 @@ import os
def execute(args):
"""Portable execution with process replacement"""
os.execv(args[0], args)
if args.get("path", None):
os.environ['PATH'] = args["path"]
os.execv(args["launch_args"][0], args["launch_args"])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment