Commit 120c271d authored by Łukasz Nowak's avatar Łukasz Nowak

Move back templates to buildout.

They have to be passed thourght slapos.recipe.template.
parent 651b81f8
......@@ -27,7 +27,6 @@
from slapos.recipe.librecipe import GenericSlapRecipe
import os
import json
import pkg_resources
ZOPE_PORT_BASE = 12000
ZEO_PORT_BASE = 15000
......@@ -52,8 +51,7 @@ class Recipe(GenericSlapRecipe):
part_list = []
for zeo_id, zeo_configuration in json_data['zeo'].iteritems():
current_zeo_port += 1
output += pkg_resources.resource_string(__name__,
'template/snippet-zeo.cfg') % dict(
output += open(self.options['snippet-zeo']).read() % dict(
zeo_id=zeo_id,
zeo_port=current_zeo_port,
storage_list=' '.join([str(q['zodb']) for q in zeo_configuration])
......@@ -62,12 +60,11 @@ class Recipe(GenericSlapRecipe):
"zeo-instance-%s" % zeo_id,
"logrotate-entry-zeo-%s" % zeo_id
])
prepend = pkg_resources.resource_string(__name__,
'template/instance.cfg') % dict(
prepend = open(self.options['snippet-zope']).read() % dict(
part_list=' \n'.join([' '+q for q in part_list]))
output = prepend + output
print output
raise NotImplementedError
with open(self.options['output'], 'w') as f:
f.write(output)
def _install(self):
if not os.path.exists(self.dirname):
......
......@@ -63,7 +63,9 @@ offline = true
[dynamic-template-tidstorage]
recipe = slapos.cookbook:generate.erp5.tidstorage
# output is in parts
snippet-zeo = ${template-snippet-zeo:output}
snippet-zope = ${template-snippet-zope-zeo-master:output}
snippet-zope-zeo = ${template-snippet-zope:output}
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
......
......@@ -69,7 +69,7 @@ configurator_bt5_list = erp5_core_proxy_field_legacy erp5_full_text_myisam_catal
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum = e6fda1efe48316e89299882389a44726
md5sum = 1b4434eb1fb2c337679d2562a56debf9
output = ${buildout:directory}/template.cfg
mode = 0644
......@@ -94,6 +94,27 @@ md5sum = 25bd7e8dfa2d7588c6c2c648cd291b47
output = ${buildout:directory}/template-erp5-production.cfg
mode = 0644
[template-snippet-zeo]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/snippet-zeo.cfg
md5sum = dfaf9cc1caa6a69b67b09480fb544854
output = ${buildout:directory}/template-snippet-zeo.cfg
mode = 0644
[template-snippet-zope-zeo-master]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/snippet-zope-zeo-master.cfg
md5sum = 7596aa311c1187b05197e3b44b41727b
output = ${buildout:directory}/template-snippet-zope-zeo-master.cfg
mode = 0644
[template-snippet-zope]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/snippet-zope.cfg
md5sum = e903614e27b384c330f76e77a99b831f
output = ${buildout:directory}/template-snippet-zope.cfg
mode = 0644
[validator]
# Default json schema for instance parameters.
recipe = slapos.recipe.template
......
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