[Zodb-checkins] SVN: zdaemon/trunk/ Fixed backwards incompatible change in handling of environment option. Using the environment option in Zope 2.11 was broken, as environment is a dict and not an object with a mapping attribute.

Hanno Schlichting plone at hannosch.info
Sat Mar 29 14:44:01 EDT 2008


Log message for revision 85012:
  Fixed backwards incompatible change in handling of environment option. Using the environment option in Zope 2.11 was broken, as environment is a dict and not an object with a mapping attribute.
  

Changed:
  U   zdaemon/trunk/CHANGES.txt
  U   zdaemon/trunk/setup.py
  U   zdaemon/trunk/src/zdaemon/zdctl.py

-=-
Modified: zdaemon/trunk/CHANGES.txt
===================================================================
--- zdaemon/trunk/CHANGES.txt	2008-03-29 11:33:23 UTC (rev 85011)
+++ zdaemon/trunk/CHANGES.txt	2008-03-29 18:43:54 UTC (rev 85012)
@@ -1,6 +1,14 @@
 zdaemon Changelog
 *****************
 
+zdaemon 2.0.2 (unreleased)
+==========================
+
+Bugs Fixed
+----------
+
+Fixed backwards incompatible change in handling of environment option.
+
 zdaemon 2.0.1 (2007/10/31)
 ==========================
 

Modified: zdaemon/trunk/setup.py
===================================================================
--- zdaemon/trunk/setup.py	2008-03-29 11:33:23 UTC (rev 85011)
+++ zdaemon/trunk/setup.py	2008-03-29 18:43:54 UTC (rev 85012)
@@ -37,7 +37,7 @@
 name = "zdaemon"
 setup(
     name=name,
-    version="2.1.0",
+    version="2.0.2",
     url="http://www.python.org/pypi/zdaemon",
     license="ZPL 2.1",
     description=

Modified: zdaemon/trunk/src/zdaemon/zdctl.py
===================================================================
--- zdaemon/trunk/src/zdaemon/zdctl.py	2008-03-29 11:33:23 UTC (rev 85011)
+++ zdaemon/trunk/src/zdaemon/zdctl.py	2008-03-29 18:43:54 UTC (rev 85012)
@@ -134,12 +134,15 @@
                     print "our program   =", program
                     print "daemon's args =", args
 
-        if (options.configroot is not None
-            and
-            getattr(options.configroot, 'environment', None) is not None
-            ):
-            for k, v in options.configroot.environment.mapping.items():
-                os.environ[k] = v
+        if options.configroot is not None:
+            env = getattr(options.configroot, 'environment', None)
+            if env is not None:
+                if getattr(env, 'mapping', None) is not None:
+                    for k, v in env.mapping.items():
+                        os.environ[k] = v
+                elif type(env) is type({}):
+                    for k, v in env.items():
+                        os.environ[k] = v
 
         self.set_uid()
 



More information about the Zodb-checkins mailing list