Commit 4de4494d authored by Marco Mariani's avatar Marco Mariani

simplify slapmonitor recipe with createWrapper

parent 4779756b
......@@ -24,31 +24,18 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
"""
Slapmonitor instance configuration.
"""
def __init__(self, buildout, name, options):
return GenericBaseRecipe.__init__(self, buildout, name, options)
def install(self):
config = dict(
pid_file_path=self.options['pid-file'],
database_path=self.options['database-path'],
slapmonitor_path = self.options['slapmonitor-path'],
shell_path=self.options['shell-path'],
)
# Runners
runner_path = self.createExecutable(
self.options['path'],
self.substituteTemplate(self.getTemplateFilename('slapmonitor_run.in'),
config))
return [runner_path]
options = self.options
script = self.createWrapper(name=options['path'],
command=options['slapmonitor-path'],
parameters=[
options['pid-file'],
options['database-path'],
])
return [script]
def update(self):
pass
#!%(shell_path)s
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
#
exec %(slapmonitor_path)s %(pid_file_path)s %(database_path)s
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