[Checkins] SVN: gocept.zeoraid/trunk/ Changed the recipe's pattern for generating management client scripts.

Christian Theune ct at gocept.com
Fri May 2 06:50:30 EDT 2008


Log message for revision 86085:
  Changed the recipe's pattern for generating management client scripts.
  
  Updated buildout to demonstrate fail-over capabilities of zeoraid itself.
  
  

Changed:
  U   gocept.zeoraid/trunk/CHANGES.txt
  U   gocept.zeoraid/trunk/base.cfg
  U   gocept.zeoraid/trunk/src/gocept/zeoraid/scripts/recipe.py
  U   gocept.zeoraid/trunk/src/gocept/zeoraid/scripts/recipe.txt

-=-
Modified: gocept.zeoraid/trunk/CHANGES.txt
===================================================================
--- gocept.zeoraid/trunk/CHANGES.txt	2008-05-02 10:44:06 UTC (rev 86084)
+++ gocept.zeoraid/trunk/CHANGES.txt	2008-05-02 10:50:30 UTC (rev 86085)
@@ -2,6 +2,12 @@
 Change History
 ==============
 
+1.0b2 (????-??-??)
+------------------
+
+- Changed the recipe's name pattern for management client scripts to
+  <partname>-<storagename>-manage.
+
 1.0b1 (2008-04-30)
 ------------------
 

Modified: gocept.zeoraid/trunk/base.cfg
===================================================================
--- gocept.zeoraid/trunk/base.cfg	2008-05-02 10:44:06 UTC (rev 86084)
+++ gocept.zeoraid/trunk/base.cfg	2008-05-02 10:50:30 UTC (rev 86085)
@@ -1,6 +1,6 @@
 [buildout]
 develop = . externals/ZODB
-parts = zodbscripts test server1 server2 zeo
+parts = zodbscripts test zeo1 zeo2 zeoraid1 zeoraid2
 find-links = http://download.zope.org/distribution/
 
 [test]
@@ -12,7 +12,7 @@
 [storage1]
 recipe = zc.recipe.filestorage
 
-[server1]
+[zeo1]
 recipe = zc.zodbrecipes:server
 zeo.conf = 
     <zeo>
@@ -25,7 +25,7 @@
 [storage2]
 recipe = zc.recipe.filestorage
 
-[server2]
+[zeo2]
 recipe = zc.zodbrecipes:server
 zeo.conf = 
     <zeo>
@@ -35,17 +35,14 @@
     path ${storage2:path}
     </filestorage>
 
-[storage3]
-recipe = zc.recipe.filestorage
-
-[zeo]
+[zeoraid1]
 recipe = gocept.zeoraid:server
 zeo.conf =
     <zeo>
     address 127.0.0.1:8100
     </zeo>
     %import gocept.zeoraid
-    <raidstorage 1>
+    <raidstorage main>
         <zeoclient 1>
             server localhost:8101
             storage 1
@@ -55,10 +52,23 @@
             storage 1
         </zeoclient>
     </raidstorage>
-    <raidstorage 2>
-        <filestorage 1>
-            path ${storage3:path}
-        </filestorage>
+
+[zeoraid2]
+recipe = gocept.zeoraid:server
+zeo.conf =
+    <zeo>
+    address 127.0.0.1:8103
+    </zeo>
+    %import gocept.zeoraid
+    <raidstorage main>
+        <zeoclient 1>
+            server localhost:8101
+            storage 1
+        </zeoclient>
+        <zeoclient 2>
+            server localhost:8102
+            storage 1
+        </zeoclient>
     </raidstorage>
 
 [zodbscripts]

Modified: gocept.zeoraid/trunk/src/gocept/zeoraid/scripts/recipe.py
===================================================================
--- gocept.zeoraid/trunk/src/gocept/zeoraid/scripts/recipe.py	2008-05-02 10:44:06 UTC (rev 86084)
+++ gocept.zeoraid/trunk/src/gocept/zeoraid/scripts/recipe.py	2008-05-02 10:50:30 UTC (rev 86085)
@@ -80,7 +80,7 @@
         # Create RAID control scripts for all RAID storages
         requirements, working_set = self.egg.working_set()
         for storage in storages:
-            script_name = rc + '-raid-' + storage
+            script_name = '%s-%s-manage' % (rc, storage)
             paths.append(os.path.join(self.options['rc-directory'],
                                       script_name))
             zc.buildout.easy_install.scripts(

Modified: gocept.zeoraid/trunk/src/gocept/zeoraid/scripts/recipe.txt
===================================================================
--- gocept.zeoraid/trunk/src/gocept/zeoraid/scripts/recipe.txt	2008-05-02 10:44:06 UTC (rev 86084)
+++ gocept.zeoraid/trunk/src/gocept/zeoraid/scripts/recipe.txt	2008-05-02 10:50:30 UTC (rev 86085)
@@ -13,13 +13,13 @@
     >>> write('buildout.cfg',
     ... '''
     ... [buildout]
-    ... parts = zodb server
+    ... parts = zodb zeoraid
     ...
     ... [zodb]
     ... recipe = zc.recipe.egg:script
     ... eggs = ZODB3
     ... 
-    ... [server]
+    ... [zeoraid]
     ... recipe = gocept.zeoraid:server
     ... zeo.conf = 
     ...    <zeo>
@@ -49,20 +49,20 @@
     Generated script '/sample-buildout/bin/fsrefs'.
     Generated script '/sample-buildout/bin/repozo'.
     Generated script '/sample-buildout/bin/fsoids'.
-    Installing server.
-    Generated script '/sample-buildout/bin/server'.
-    Generated script '/sample-buildout/bin/server-raid-1'.
+    Installing zeoraid.
+    Generated script '/sample-buildout/bin/zeoraid'.
+    Generated script '/sample-buildout/bin/zeoraid-1-manage'.
 
 We get 2 things.  We get a directory in parts containing ZEO and
 zdaemon configuration files:
 
-    >>> ls('parts', 'server')
+    >>> ls('parts', 'zeoraid')
     -  zdaemon.conf
     -  zeo.conf
 
 Let's look at the configuration files:
 
-    >>> cat('parts', 'server', 'zeo.conf')
+    >>> cat('parts', 'zeoraid', 'zeo.conf')
     %import gocept.zeoraid
     <BLANKLINE>
     <zeo>
@@ -97,16 +97,16 @@
     -  mkzeoinst
     -  repozo
     -  runzeo
-    -  server
-    -  server-raid-1
     -  zeoctl
     -  zeopack
     -  zeopasswd
+    -  zeoraid
+    -  zeoraid-1-manage
 
 
 We have an additional RAID control script:
 
-    >>> cat('bin', 'server-raid-1')
+    >>> cat('bin', 'zeoraid-1-manage')
     #!/.../python
     <BLANKLINE>
     import sys
@@ -149,13 +149,13 @@
     >>> write('buildout.cfg',
     ... '''
     ... [buildout]
-    ... parts = zodb server
+    ... parts = zodb zeoraid
     ... 
     ... [zodb]
     ... recipe = zc.recipe.egg:script
     ... eggs = ZODB3
     ... 
-    ... [server]
+    ... [zeoraid]
     ... recipe = gocept.zeoraid:server
     ... zeo.conf = 
     ...    <zeo>
@@ -182,27 +182,27 @@
     ... ''' % globals())
 
     >>> print system(buildout),
-    Uninstalling server.
+    Uninstalling zeoraid.
     Updating zodb.
-    Installing server.
-    Generated script '/sample-buildout/rc/demo-server'.
-    Generated script '/sample-buildout/rc/demo-server-raid-main'.
+    Installing zeoraid.
+    Generated script '/sample-buildout/rc/demo-zeoraid'.
+    Generated script '/sample-buildout/rc/demo-zeoraid-main-manage'.
 
 Now, the parts directory and the control script will be gone:
 
     >>> import os
-    >>> os.path.exists(join('parts', 'server'))
+    >>> os.path.exists(join('parts', 'zeoraid'))
     False
-    >>> os.path.exists(join('bin', 'server'))
+    >>> os.path.exists(join('bin', 'zeoraid'))
     False
 
 Instead, the control script will be in the rc directory:
 
     >>> ls('rc')
-    -  demo-server
-    -  demo-server-raid-main
+    -  demo-zeoraid
+    -  demo-zeoraid-main-manage
 
-    >>> cat('rc', 'demo-server-raid-main')
+    >>> cat('rc', 'demo-zeoraid-main-manage')
     #!/.../python
     <BLANKLINE>
     import sys



More information about the Checkins mailing list