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

Simplify and decouple fully ZODB generation from Zope installation.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45781 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b11e3a81
...@@ -72,7 +72,9 @@ class Recipe(BaseSlapRecipe): ...@@ -72,7 +72,9 @@ class Recipe(BaseSlapRecipe):
zodb_root_path = os.path.join(zodb_dir, 'root.fs') zodb_root_path = os.path.join(zodb_dir, 'root.fs')
zope_access = self.installZope(ip=self.getLocalIPv4Address(), zope_access = self.installZope(ip=self.getLocalIPv4Address(),
port=12000 + 1, name='zope_%s' % 1, port=12000 + 1, name='zope_%s' % 1,
zodb_root_path=zodb_root_path) zodb_configuration_string=self.substituteTemplate(
self.getTemplateFilename('zope-zodb-snippet.conf.in'),
dict(zodb_root_path=zodb_root_path)), with_timerservice=True)
apache_conf = dict( apache_conf = dict(
apache_login=self.installLoginApache(ip=self.getGlobalIPv6Address(), apache_login=self.installLoginApache(ip=self.getGlobalIPv6Address(),
port=13000, backend=zope_access, key=ca_conf['login_key'], port=13000, backend=zope_access, key=ca_conf['login_key'],
...@@ -543,16 +545,13 @@ class Recipe(BaseSlapRecipe): ...@@ -543,16 +545,13 @@ class Recipe(BaseSlapRecipe):
self.path_list.append(wrapper) self.path_list.append(wrapper)
return zeo_configuration_dict return zeo_configuration_dict
def installZope(self, ip, port, name, zodb_root_path=None, def installZope(self, ip, port, name, zodb_configuration_string,
with_timerservice=False, zodb_configuration_string=None): with_timerservice=False):
# Create zope configuration file # Create zope configuration file
zope_config = dict( zope_config = dict(
products=self.options['products'], products=self.options['products'],
) )
if zodb_configuration_string is None: zope_config['zodb_configuration_string'] = zodb_configuration_string
zope_config.update(zodb_root_path=zodb_root_path)
else:
zope_config.update(zodb_configuration_string=zodb_configuration_string)
zope_config['instance'] = self.erp5_directory zope_config['instance'] = self.erp5_directory
zope_config['event_log'] = os.path.join(self.log_directory, zope_config['event_log'] = os.path.join(self.log_directory,
'%s-event.log' % name) '%s-event.log' % name)
...@@ -579,13 +578,7 @@ class Recipe(BaseSlapRecipe): ...@@ -579,13 +578,7 @@ class Recipe(BaseSlapRecipe):
zope_config['path'] = ':'.join([self.bin_directory] + zope_config['path'] = ':'.join([self.bin_directory] +
os.environ['PATH'].split(':')) os.environ['PATH'].split(':'))
if zodb_configuration_string is None: zope_wrapper_template_location = self.getTemplateFilename('zope.conf.in')
zope_wrapper_template_location = self.getTemplateFilename(
'zope.conf.simple.in')
with_timerservice = True
else:
zope_wrapper_template_location = self.getTemplateFilename('zope.conf.in')
zope_conf_content = self.substituteTemplate( zope_conf_content = self.substituteTemplate(
zope_wrapper_template_location, zope_config) zope_wrapper_template_location, zope_config)
if with_timerservice: if with_timerservice:
......
<zodb_db root>
<filestorage>
path %(zodb_root_path)s
</filestorage>
mount-point /
</zodb_db>
## Zope 2 configuration file generated by SlapOS
# Some defines
%%define INSTANCE %(instance)s
instancehome $INSTANCE
# Used products
%(products)s
# Environment override
<environment>
TMP %(tmp_directory)s
TMPDIR %(tmp_directory)s
HOME %(tmp_directory)s
PATH %(path)s
</environment>
# No need to debug
debug-mode off
# One thread is safe enough
zserver-threads 1
# File location
pid-filename %(pid-filename)s
lock-filename %(lock-filename)s
# Logging configuration
<eventlog>
<logfile>
path %(event_log)s
</logfile>
</eventlog>
<logger access>
<logfile>
path %(z2_log)s
</logfile>
</logger>
# Serving configuration
<http-server>
address %(address)s
</http-server>
# ZODB configuration
<zodb_db root>
# Main FileStorage database
<filestorage>
# See .../ZODB/component.xml for directives (sectiontype
# "filestorage").
path %(zodb_root_path)s
</filestorage>
mount-point /
</zodb_db>
<zoperunner>
program $INSTANCE/bin/runzope
</zoperunner>
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