Commit 4c3ea6ea authored by Chris Withers's avatar Chris Withers

Revert changes made in the name of #375322.

These changes weren't discussed with the community first, they break backwards compatibility, and environment should logically be one dict-like object, not a sequence of dicts.
parent 6d9b05d7
...@@ -14,10 +14,6 @@ Features Added ...@@ -14,10 +14,6 @@ Features Added
- zExceptions.convertExceptionType: new API, breaking out conversion of - zExceptions.convertExceptionType: new API, breaking out conversion of
exception names to exception types from 'upgradeException'. exception names to exception types from 'upgradeException'.
- Launchpad #375322: the <environment> section within the zope.conf
file is now a multisection in order to provide a more modular configuration
support.
- Launchpad #374719: introducing new ZPublisher events: - Launchpad #374719: introducing new ZPublisher events:
PubStart, PubSuccess, PubFailure, PubAfterTraversal and PubBeforeCommit. PubStart, PubSuccess, PubFailure, PubAfterTraversal and PubBeforeCommit.
......
...@@ -184,10 +184,8 @@ def root_handler(config): ...@@ -184,10 +184,8 @@ def root_handler(config):
""" """
# Set environment variables # Set environment variables
d = {} for k,v in config.environment.items():
for s in config.environment: os.environ[k] = v
d.update(s)
os.environ.update(d)
# Add directories to the pythonpath # Add directories to the pythonpath
instancelib = os.path.join(config.instancehome, 'lib', 'python') instancelib = os.path.join(config.instancehome, 'lib', 'python')
......
...@@ -101,23 +101,9 @@ class StartupTestCase(unittest.TestCase): ...@@ -101,23 +101,9 @@ class StartupTestCase(unittest.TestCase):
NSYNC doesnt NSYNC doesnt
</environment> </environment>
""") """)
items = conf.environment[0].items() items = conf.environment.items()
items.sort() items.sort()
self.assertEqual(items, [("FEARFACTORY", "rocks"), ("NSYNC","doesnt")]) self.assertEqual(items, [("FEARFACTORY", "rocks"), ("NSYNC","doesnt")])
conf, handler = self.load_config_text("""\
# instancehome is here since it's required
instancehome <<INSTANCE_HOME>>
<environment>
FEARFACTORY rocks
</environment>
<environment>
NSYNC doesnt
</environment>
""")
self.assertEqual(len(conf.environment), 2)
# in principle, we should test the handler as well
# But this would have vast side effects
# Thus, we test with a non regression test
def test_ms_author_via(self): def test_ms_author_via(self):
import webdav import webdav
......
...@@ -292,14 +292,14 @@ ...@@ -292,14 +292,14 @@
</description> </description>
</multisection> </multisection>
<multisection type="environment" attribute="environment" name="*"> <section type="environment" attribute="environment" name="*">
<description> <description>
A section which allows a user to define arbitrary key-value pairs for A section which allows a user to define arbitrary key-value pairs for
use as environment variables during Zope's run cycle. It use as environment variables during Zope's run cycle. It
is not recommended to set system-related environment variables such as is not recommended to set system-related environment variables such as
PYTHONPATH within this section. PYTHONPATH within this section.
</description> </description>
</multisection> </section>
<key name="instancehome" datatype="existing-directory" <key name="instancehome" datatype="existing-directory"
required="yes"> required="yes">
......
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