Commit f6ff339a authored by Andreas Jung's avatar Andreas Jung

added support for zdaemoni 2 (expects to use a 'maaping' attribute

of the environ)
(This patch landed first on the 2.11 branch (by TS))
parent 0908f35c
......@@ -15,6 +15,7 @@
"""Datatypes for the Zope schema for use with ZConfig."""
import os
from UserDict import UserDict
from ZConfig.components.logger import logger
from ZODB.config import ZODBDatabase
......@@ -108,6 +109,13 @@ def python_dotted_path(name):
ob = importable_name(name) # will fail in course
return name
class zdaemonEnvironDict(UserDict):
# zdaemon 2 expects to use a 'mapping' attribute of the environ object.
@property
def mapping(self):
return self.data
# Datatype for the root configuration object
# (adds the softwarehome and zopehome fields; default values for some
# computed paths, configures the dbtab)
......@@ -120,9 +128,9 @@ def root_config(section):
section.softwarehome = swhome
section.zopehome = os.path.dirname(os.path.dirname(swhome))
if section.environment is None:
section.environment = {}
section.environment = zdaemonEnvironDict()
if section.cgi_environment is None:
section.cgi_environment = {}
section.cgi_environment = zdaemonEnvironDict()
if section.clienthome is None:
section.clienthome = os.path.join(section.instancehome, "var")
# set up defaults for pid_filename and lock_filename if they're
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment