[Erp5-report] r45781 luke - in /erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5:...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue May 3 09:32:34 CEST 2011


Author: luke
Date: Tue May  3 09:32:34 2011
New Revision: 45781

URL: http://svn.erp5.org?rev=45781&view=rev
Log:
Simplify and decouple fully ZODB generation from Zope installation.

Added:
    erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/zope-zodb-snippet.conf.in
Removed:
    erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/zope.conf.simple.in
Modified:
    erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py

Modified: erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py
URL: http://svn.erp5.org/erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py?rev=45781&r1=45780&r2=45781&view=diff
==============================================================================
--- erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py [utf8] (original)
+++ erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py [utf8] Tue May  3 09:32:34 2011
@@ -72,7 +72,9 @@ class Recipe(BaseSlapRecipe):
     zodb_root_path = os.path.join(zodb_dir, 'root.fs')
     zope_access = self.installZope(ip=self.getLocalIPv4Address(),
           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_login=self.installLoginApache(ip=self.getGlobalIPv6Address(),
           port=13000, backend=zope_access, key=ca_conf['login_key'],
@@ -543,16 +545,13 @@ class Recipe(BaseSlapRecipe):
       self.path_list.append(wrapper)
     return zeo_configuration_dict
 
-  def installZope(self, ip, port, name, zodb_root_path=None,
-      with_timerservice=False, zodb_configuration_string=None):
+  def installZope(self, ip, port, name, zodb_configuration_string,
+      with_timerservice=False):
     # Create zope configuration file
     zope_config = dict(
         products=self.options['products'],
     )
-    if zodb_configuration_string is None:
-      zope_config.update(zodb_root_path=zodb_root_path)
-    else:
-      zope_config.update(zodb_configuration_string=zodb_configuration_string)
+    zope_config['zodb_configuration_string'] = zodb_configuration_string
     zope_config['instance'] = self.erp5_directory
     zope_config['event_log'] = os.path.join(self.log_directory,
         '%s-event.log' % name)
@@ -579,13 +578,7 @@ class Recipe(BaseSlapRecipe):
     zope_config['path'] = ':'.join([self.bin_directory] +
         os.environ['PATH'].split(':'))
 
-    if zodb_configuration_string is None:
-      zope_wrapper_template_location = self.getTemplateFilename(
-          'zope.conf.simple.in')
-      with_timerservice = True
-    else:
-      zope_wrapper_template_location = self.getTemplateFilename('zope.conf.in')
-
+    zope_wrapper_template_location = self.getTemplateFilename('zope.conf.in')
     zope_conf_content = self.substituteTemplate(
         zope_wrapper_template_location, zope_config)
     if with_timerservice:

Added: erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/zope-zodb-snippet.conf.in
URL: http://svn.erp5.org/erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/zope-zodb-snippet.conf.in?rev=45781&view=auto
==============================================================================
--- erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/zope-zodb-snippet.conf.in (added)
+++ erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/zope-zodb-snippet.conf.in [utf8] Tue May  3 09:32:34 2011
@@ -0,0 +1,6 @@
+<zodb_db root>
+    <filestorage>
+      path %(zodb_root_path)s
+    </filestorage>
+    mount-point /
+</zodb_db>

Removed: erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/zope.conf.simple.in
URL: http://svn.erp5.org/erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/zope.conf.simple.in?rev=45780&view=auto
==============================================================================
--- erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/zope.conf.simple.in [utf8] (original)
+++ erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/zope.conf.simple.in (removed)
@@ -1,57 +0,0 @@
-## 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>



More information about the Erp5-report mailing list