Commit f2fcfd91 authored by Marco Mariani's avatar Marco Mariani

simplify slapreport recipe with createWrapper

parent 4de4494d
...@@ -24,36 +24,23 @@ ...@@ -24,36 +24,23 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe): class Recipe(GenericBaseRecipe):
"""
Slapmonitor instance configuration.
"""
def __init__(self, buildout, name, options):
return GenericBaseRecipe.__init__(self, buildout, name, options)
def install(self): def install(self):
config = dict( options = self.options
pid_file_path=self.options['pid-file'], script = self.createWrapper(name=options['path'],
consumption_log_path=self.options['consumption-log-path'], command=options['slapreport-path'],
database_path=self.options['database-path'], parameters=[
slapreport_path = self.options['slapreport-path'], options['pid-file'],
logbox_ip = self.options['logbox-ip'], options['consumption-log-path'],
logbox_port = self.options['logbox-port'], options['database-path'],
logbox_user = self.options['logbox-user'], options['logbox-ip'],
logbox_passwd = self.options['logbox-passwd'], options['logbox-port'],
shell_path=self.options['shell-path'], options['logbox-user'],
) options['logbox-passwd'],
])
# Runners return [script]
runner_path = self.createExecutable(
self.options['path'],
self.substituteTemplate(self.getTemplateFilename('slapreport_run.in'),
config))
return [runner_path]
def update(self):
pass
#!%(shell_path)s
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
#
exec %(slapreport_path)s %(pid_file_path)s %(consumption_log_path)s %(database_path)s %(logbox_ip)s %(logbox_port)s %(logbox_user)s %(logbox_passwd)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