Commit 34ec5983 authored by Łukasz Nowak's avatar Łukasz Nowak

Setup environment in wrapper script instead of zope.conf

zope.conf is read quite lite during zope startup and some modules are using
environment variables to be set up (like DateTime) *before* zope.conf is read.
parent 1fc5b4c8
......@@ -666,10 +666,6 @@ class Recipe(BaseSlapRecipe):
self.erp5_directory, 'Products'))
zope_config['products'] = '\n'.join(prefixed_products)
zope_config['address'] = '%s:%s' % (ip, port)
zope_environment_list = []
for envk, envv in zope_environment.iteritems():
zope_environment_list.append('%s %s' % (envk, envv))
zope_config['environment'] = "\n".join(zope_environment_list)
zope_wrapper_template_location = self.getTemplateFilename('zope.conf.in')
zope_conf_content = self.substituteTemplate(
......@@ -692,10 +688,11 @@ class Recipe(BaseSlapRecipe):
self.path_list.append(zope_conf_path)
# Create init script
wrapper = zc.buildout.easy_install.scripts([(name,
'slapos.recipe.librecipe.execute', 'execute')], self.ws, sys.executable,
'slapos.recipe.librecipe.execute', 'executee')], self.ws, sys.executable,
self.wrapper_directory, arguments=[
self.options['runzope_binary'].strip(), '-C', zope_conf_path]
)[0]
[self.options['runzope_binary'].strip(), '-C', zope_conf_path],
zope_environment
])[0]
self.path_list.append(wrapper)
return zope_config['address']
......
......@@ -7,10 +7,8 @@ instancehome $INSTANCE
# Used products
%(products)s
# Environment override
<environment>
%(environment)s
</environment>
# Environment is setup in running wrapper script
# Reason: zope.conf is read too late for some componets
# No need to debug
debug-mode off
......
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