From 5689dcbd724cf75959ea99702354d4abd37e036a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Wed, 4 May 2011 14:04:50 +0000
Subject: [PATCH] Allow configuring Zope node with TIDStorage.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45837 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 slapos/recipe/erp5/src/slapos/recipe/erp5/__init__.py      | 7 ++++++-
 .../recipe/erp5/template/zope-tidstorage-snippet.conf.in   | 6 ++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 slapos/recipe/erp5/src/slapos/recipe/erp5/template/zope-tidstorage-snippet.conf.in

diff --git a/slapos/recipe/erp5/src/slapos/recipe/erp5/__init__.py b/slapos/recipe/erp5/src/slapos/recipe/erp5/__init__.py
index 61a1f51768..843ed5804a 100644
--- a/slapos/recipe/erp5/src/slapos/recipe/erp5/__init__.py
+++ b/slapos/recipe/erp5/src/slapos/recipe/erp5/__init__.py
@@ -607,7 +607,7 @@ class Recipe(BaseSlapRecipe):
     return dict(host=ip, port=port)
 
   def installZope(self, ip, port, name, zodb_configuration_string,
-      with_timerservice=False):
+      with_timerservice=False, tidstorage_config=None):
     # Create zope configuration file
     zope_config = dict(
         products=self.options['products'],
@@ -645,6 +645,11 @@ class Recipe(BaseSlapRecipe):
     if with_timerservice:
       zope_conf_content += self.substituteTemplate(
           self.getTemplateFilename('zope.conf.timerservice.in'), zope_config)
+    if tidstorage_config is not None:
+      zope_conf_content += self.substituteTemplate(
+          self.getTemplateFilename('zope-tidstorage-snippet.conf.in'),
+          tidstorage_config)
+
     zope_conf_path = self.createConfigurationFile("%s.conf" % name,
         zope_conf_content)
     self.path_list.append(zope_conf_path)
diff --git a/slapos/recipe/erp5/src/slapos/recipe/erp5/template/zope-tidstorage-snippet.conf.in b/slapos/recipe/erp5/src/slapos/recipe/erp5/template/zope-tidstorage-snippet.conf.in
new file mode 100644
index 0000000000..cced8c752a
--- /dev/null
+++ b/slapos/recipe/erp5/src/slapos/recipe/erp5/template/zope-tidstorage-snippet.conf.in
@@ -0,0 +1,6 @@
+
+# TIDStorage connection
+<product-config TIDStorage>
+  backend-ip %(host)s
+  backend-port %(port)s
+</product-config>
-- 
2.30.9