Commit 702aa9be authored by Gabriel Monnerat's avatar Gabriel Monnerat

refactor code to create script to run varnish using slapos.recipe.librecipe.execute

parent 3614fd34
...@@ -283,12 +283,18 @@ class Recipe(BaseSlapRecipe): ...@@ -283,12 +283,18 @@ class Recipe(BaseSlapRecipe):
config_file = self.createConfigurationFile("%s.conf" % name, config_file = self.createConfigurationFile("%s.conf" % name,
self.substituteTemplate(self.getTemplateFilename('varnish.vcl.in'), self.substituteTemplate(self.getTemplateFilename('varnish.vcl.in'),
dict(backend_host=backend_host,backend_port=backend_port))) dict(backend_host=backend_host, backend_port=backend_port)))
varnish_config["configuration_file"] = config_file varnish_argument_list = [varnish_config['varnishd_binary'].strip(),
self.path_list.append(self.createRunningWrapper('varnishd', "-F", "-n", directory, "-P", varnish_config["pid"], "-f", config_file,
self.substituteTemplate(self.getTemplateFilename('varnishd.in'), "-a", varnish_config["port"], "-T", varnish_config["control_port"],
varnish_config))) "-s", varnish_config["storage"]]
wrapper = zc.buildout.easy_install.scripts([('varnishd',
'slapos.recipe.librecipe.execute', 'execute')], self.ws,
sys.executable, self.wrapper_directory, arguments=varnish_argument_list,
)[0]
self.path_list.append(wrapper)
return varnish_config return varnish_config
......
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