[Checkins] SVN: zc.zodbrecipes/trunk/ The server recipe now honors the deployment name option.

Jim Fulton jim at zope.com
Mon Feb 18 16:56:28 EST 2008


Log message for revision 84028:
  The server recipe now honors the deployment name option.
  

Changed:
  U   zc.zodbrecipes/trunk/README.txt
  U   zc.zodbrecipes/trunk/zc/zodbrecipes/__init__.py
  U   zc.zodbrecipes/trunk/zc/zodbrecipes/zeo.txt

-=-
Modified: zc.zodbrecipes/trunk/README.txt
===================================================================
--- zc.zodbrecipes/trunk/README.txt	2008-02-18 16:14:00 UTC (rev 84027)
+++ zc.zodbrecipes/trunk/README.txt	2008-02-18 21:56:28 UTC (rev 84028)
@@ -9,6 +9,14 @@
 Changes
 *******
 
+0.4 (2008-02-18)
+================
+
+New Features
+------------
+
+The server recipe now honors the deployment name option.
+
 0.3.1 (2008-01-03)
 ==================
 

Modified: zc.zodbrecipes/trunk/zc/zodbrecipes/__init__.py
===================================================================
--- zc.zodbrecipes/trunk/zc/zodbrecipes/__init__.py	2008-02-18 16:14:00 UTC (rev 84027)
+++ zc.zodbrecipes/trunk/zc/zodbrecipes/__init__.py	2008-02-18 21:56:28 UTC (rev 84028)
@@ -27,13 +27,15 @@
 
         deployment = self.deployment = options.get('deployment')
         if deployment:
+            options['deployment-name'] = buildout[deployment].get(
+                'name', deployment)
             options['rc-directory'] = buildout[deployment]['rc-directory']
             options['run-directory'] = buildout[deployment]['run-directory']
             options['log-directory'] = buildout[deployment]['log-directory']
             options['etc-directory'] = buildout[deployment]['etc-directory']
             options['logrotate'] = os.path.join(
                 buildout[deployment]['logrotate-directory'],
-                deployment + '-' + name)
+                options['deployment-name'] + '-' + name)
             options['crontab-directory'] = buildout[
                 deployment]['crontab-directory']
             options['user'] = buildout[deployment]['user']
@@ -84,7 +86,7 @@
                                           self.name+'-zeo.log')
             socket_path = os.path.join(run_directory,
                                        self.name+'-zdaemon.sock')
-            rc = deployment + '-' + self.name
+            rc = options['deployment-name'] + '-' + self.name
 
             logrotate = options['logrotate']
             open(logrotate, 'w').write(logrotate_template % dict(
@@ -109,7 +111,7 @@
                         'Too many values in pack option')
                 pack_path = os.path.join(
                     options['crontab-directory'],
-                    "pack-%s-%s" % (deployment, self.name),
+                    "pack-%s-%s" % (options['deployment-name'], self.name),
                     )
                 if not os.path.exists(options['zeopack']):
                     logger.warn("Couln'e find zeopack script, %r",

Modified: zc.zodbrecipes/trunk/zc/zodbrecipes/zeo.txt
===================================================================
--- zc.zodbrecipes/trunk/zc/zodbrecipes/zeo.txt	2008-02-18 16:14:00 UTC (rev 84027)
+++ zc.zodbrecipes/trunk/zc/zodbrecipes/zeo.txt	2008-02-18 21:56:28 UTC (rev 84028)
@@ -548,6 +548,7 @@
     ... shell-script = true
     ...
     ... [demo]
+    ... name = Demo
     ... crontab-directory = %(cron)s
     ... etc-directory = %(etc)s
     ... log-directory = %(log)s
@@ -563,9 +564,9 @@
     Installing zdaemon.
     Generated script '/sample-buildout/bin/zdaemon'.
     Installing server.
-    zc.zodbrecipes: Generated shell script '/sample-buildout/rc/demo-server'.
+    zc.zodbrecipes: Generated shell script '/sample-buildout/rc/Demo-server'.
 
-    >>> cat('rc', 'demo-server')
+    >>> cat('rc', 'Demo-server')
     #!/bin/sh
     su bob -c \
       "/sample-buildout/bin/zdaemon -C '/sample-buildout/etc/server-zdaemon.conf' $*"



More information about the Checkins mailing list