Commit e658d53f authored by Łukasz Nowak's avatar Łukasz Nowak

Allow full zeo configuraiton.

Storage name does not map required file name.
parent 20c649eb
...@@ -52,31 +52,33 @@ class Recipe(GenericSlapRecipe): ...@@ -52,31 +52,33 @@ class Recipe(GenericSlapRecipe):
zope_dict = {} zope_dict = {}
zope_connection_dict = {} zope_connection_dict = {}
snippet_zeo = open(self.options['snippet-zeo']).read() snippet_zeo = open(self.options['snippet-zeo']).read()
for zeo_id, zeo_configuration in json_data['zeo'].iteritems(): for zeo_id, zeo_configuration_list in json_data['zeo'].iteritems():
storage_list = []
a = storage_list.append
for zeo_slave in zeo_configuration_list:
zope_connection_dict[zeo_slave['storage-name']] = {
'zope-cache-size': zeo_slave['zope-cache-size'],
'zeo-cache-size': zeo_slave['zeo-cache-size'],
'mount-point': zeo_slave['mount-point'] % {'site-id': site_id},
'storage-name': zeo_slave['storage-name'],
'server': '${zeo-instance-%(zeo-id)s:ip}:${zeo-instance-%(zeo-id)s:port}' % {'zeo-id': zeo_id}
}
a(' storage-name=%(storage-name)s zodb-name=%(zodb-name)s' % zeo_slave)
current_zeo_port += 1 current_zeo_port += 1
output += snippet_zeo % dict( output += snippet_zeo % dict(
zeo_id=zeo_id, zeo_id=zeo_id,
zeo_port=current_zeo_port, zeo_port=current_zeo_port,
storage_list=' '.join([str(q['zodb']) for q in zeo_configuration]) storage_list='\n'.join(storage_list)
) + '\n' )
part_list.extend([ part_list.extend([
"zeo-instance-%s" % zeo_id, "zeo-instance-%s" % zeo_id,
"logrotate-entry-zeo-%s" % zeo_id "logrotate-entry-zeo-%s" % zeo_id
]) ])
for zeo_slave in zeo_configuration:
zope_connection_dict[zeo_slave['zodb']] = {
'zope-cache-size': zeo_slave['zope-cache-size'],
'zeo-cache-size': zeo_slave['zeo-cache-size'],
'mount-point': zeo_slave['mount-point'] % {'site-id': site_id},
'storage': zeo_slave['zodb'],
'name': zeo_slave['zodb'],
'server': '${zeo-instance-%(zeo-id)s:ip}:${zeo-instance-%(zeo-id)s:port}' % {'zeo-id': zeo_id}
}
zeo_connection_list = [] zeo_connection_list = []
a = zeo_connection_list.append a = zeo_connection_list.append
for k, v in zope_connection_dict.iteritems(): for k, v in zope_connection_dict.iteritems():
a(' zeo-cache-size=%(zeo-cache-size)s zope-cache-size=%(zope-cache-size)s server=%(server)s mount-point=%(mount-point)s ' % v) a(' zeo-cache-size=%(zeo-cache-size)s zope-cache-size=%(zope-cache-size)s server=%(server)s mount-point=%(mount-point)s storage-name=%(storage-name)s' % v)
zeo_connection_string = '\n'.join(zeo_connection_list) zeo_connection_string = '\n'.join(zeo_connection_list)
zope_dict.update( zope_dict.update(
timezone=json_data['timezone'], timezone=json_data['timezone'],
......
...@@ -4,7 +4,8 @@ log-path = $${basedirectory:log}/zeo-%(zeo_id)s.log ...@@ -4,7 +4,8 @@ log-path = $${basedirectory:log}/zeo-%(zeo_id)s.log
pid-path = $${basedirectory:run}/zeo-%(zeo_id)s.pid pid-path = $${basedirectory:run}/zeo-%(zeo_id)s.pid
conf-path = $${rootdirectory:etc}/zeo-%(zeo_id)s.conf conf-path = $${rootdirectory:etc}/zeo-%(zeo_id)s.conf
port = %(zeo_port)s port = %(zeo_port)s
storage = %(storage_list)s storage =
%(storage_list)s
wrapper-path = $${basedirectory:services}/zeo-%(zeo_id)s wrapper-path = $${basedirectory:services}/zeo-%(zeo_id)s
[logrotate-entry-zeo-%(zeo_id)s] [logrotate-entry-zeo-%(zeo_id)s]
......
...@@ -81,7 +81,7 @@ mode = 0644 ...@@ -81,7 +81,7 @@ mode = 0644
[template-snippet-zeo] [template-snippet-zeo]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/snippet-zeo.cfg url = ${:_profile_base_location_}/snippet-zeo.cfg
md5sum = 83444a88b9df991941e35c1a56dd28a2 md5sum = 5295ea5ceedf861286bab16fc546a9c6
output = ${buildout:directory}/template-snippet-zeo.cfg output = ${buildout:directory}/template-snippet-zeo.cfg
mode = 0644 mode = 0644
......
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