Commit 8df960c7 authored by Łukasz Nowak's avatar Łukasz Nowak

Implement site.zcml and include deadlockdebugger.

Current configuration was not using site.zcml, now it is fetched from
zope.

Provide simple way of package activation.

Install z3c.deadlockdebugger with required dependency and activate it if
required.
parent 49bbf182
......@@ -29,6 +29,7 @@ setup(
'zc.recipe.egg',
'setuptools',
'slapos.lib.recipe',
'Zope2',
],
namespace_packages = ['slapos', 'slapos.recipe'],
entry_points = {'zc.buildout': ['default = %s:Recipe' % name]},
......
......@@ -465,8 +465,11 @@ class Recipe(BaseSlapRecipe):
'lib',
'tests',
'Products',
'etc',
):
self._createDirectory(os.path.join(self.erp5_directory, directory))
self._createDirectory(os.path.join(self.erp5_directory, 'etc',
'package-includes'))
return user, password
def installERP5Site(self, user, password, zope_access, mysql_conf,
......@@ -614,12 +617,21 @@ class Recipe(BaseSlapRecipe):
return dict(host=ip, port=port)
def installZope(self, ip, port, name, zodb_configuration_string,
with_timerservice=False, tidstorage_config=None, thread_amount=1):
with_timerservice=False, tidstorage_config=None, thread_amount=1,
with_deadlockdebugger=True):
# Create zope configuration file
zope_config = dict(
products=self.options['products'],
thread_amount=thread_amount
)
# configure default Zope2 zcml
open(os.path.join(self.erp5_directory, 'etc', 'site.zcml'), 'w').write(
pkg_resources.resource_string('Zope2', 'utilities/skel/etc/site.zcml'))
if with_deadlockdebugger:
open(os.path.join(self.erp5_directory, 'etc', 'package-includes', 'deadlockdebugger-configure.zcml'), 'w').write('''<configure>
<include package="zope.applicationcontrol"/>
<include package="z3c.deadlockdebugger"/>
</configure>''')
zope_config['zodb_configuration_string'] = zodb_configuration_string
zope_config['instance'] = self.erp5_directory
zope_config['event_log'] = os.path.join(self.log_directory,
......
......@@ -331,6 +331,9 @@ eggs =
# Products.PortalTransforms
# Dependency for our fork of PortalTransforms
StructuredText
# replacement of DeadlockDebugger
zope.applicationcontrol
z3c.deadlockdebugger
# parameterizing the version of the generated python interpreter name by the
# python section version causes dependency between this egg section and the
......
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