[Zodb-checkins] SVN: ZODB/branches/3.4/ Use ZConfig's new socket
address types appropriately.
Tim Peters
tim.one at comcast.net
Thu May 19 20:57:18 EDT 2005
Log message for revision 30437:
Use ZConfig's new socket address types appropriately.
These config file keys changed:
section key was is
------- --------------- -------------- -------------------------
zeo address socket-address socket-binding-address
zeo monitor-address socket-address socket-binding-address
zeoclient server socket-address socket-connection-address
Changed:
U ZODB/branches/3.4/NEWS.txt
U ZODB/branches/3.4/src/ZEO/component.xml
U ZODB/branches/3.4/src/ZEO/runzeo.py
U ZODB/branches/3.4/src/ZEO/tests/testZEOOptions.py
U ZODB/branches/3.4/src/ZODB/config.py
-=-
Modified: ZODB/branches/3.4/NEWS.txt
===================================================================
--- ZODB/branches/3.4/NEWS.txt 2005-05-20 00:28:46 UTC (rev 30436)
+++ ZODB/branches/3.4/NEWS.txt 2005-05-20 00:57:18 UTC (rev 30437)
@@ -92,6 +92,16 @@
no longer fails. If interested, see the README file for details about
earlier version numbering schemes.
+- (3.4b1) ZConfig version 2.3 adds new socket address types, for smoother
+ default behavior across platforms. The hostname portion of
+ socket-binding-address defaults to an empty string, which acts like
+ INADDR_ANY on Windows and Linux (bind to any interface). The hostname
+ portion of socket-connection-address defaults to "127.0.0.1" (aka
+ "localhost"). In config files, the types of ``zeo`` section keys
+ ``address`` and ``monitor-address`` changed to socket-binding-address,
+ and the type of the ``zeoclient`` section key ``server`` changed to
+ socket-connection-address.
+
- (3.4a4) The default logging setup in ``runzeo.py`` was broken. It was
changed so that running ``runzeo.py`` from a command line now, and without
using a config file, prints output to the console much as ZODB 3.2 did.
@@ -137,6 +147,11 @@
- (3.4a2) A ``pdb.set_trace()`` call was mistakenly left in method
``FileStorage.modifiedInVersion()``.
+ZConfig
+-------
+
+- (3.4b1) The "standalone" release of ZODB now includes ZConfig version 2.3.
+
DemoStorage
-----------
Modified: ZODB/branches/3.4/src/ZEO/component.xml
===================================================================
--- ZODB/branches/3.4/src/ZEO/component.xml 2005-05-20 00:28:46 UTC (rev 30436)
+++ ZODB/branches/3.4/src/ZEO/component.xml 2005-05-20 00:57:18 UTC (rev 30437)
@@ -7,7 +7,7 @@
of a ZEO server except for the storage(s) to be served.
</description>
- <key name="address" datatype="socket-address"
+ <key name="address" datatype="socket-binding-address"
required="yes">
<description>
The address at which the server should listen. This can be in
@@ -45,7 +45,7 @@
</description>
</key>
- <key name="monitor-address" datatype="socket-address"
+ <key name="monitor-address" datatype="socket-binding-address"
required="no">
<description>
The address at which the monitor server should listen. If
Modified: ZODB/branches/3.4/src/ZEO/runzeo.py
===================================================================
--- ZODB/branches/3.4/src/ZEO/runzeo.py 2005-05-20 00:28:46 UTC (rev 30436)
+++ ZODB/branches/3.4/src/ZEO/runzeo.py 2005-05-20 00:57:18 UTC (rev 30437)
@@ -53,9 +53,9 @@
message = "(%s) %s" % (_pid, msg)
logger.log(level, message, exc_info=exc_info)
-def parse_address(arg):
+def parse_binding_address(arg):
# Caution: Not part of the official ZConfig API.
- obj = ZConfig.datatypes.SocketAddress(arg)
+ obj = ZConfig.datatypes.SocketBindingAddress(arg)
return obj.family, obj.address
def windows_shutdown_handler():
@@ -68,10 +68,10 @@
storages = None
def handle_address(self, arg):
- self.family, self.address = parse_address(arg)
+ self.family, self.address = parse_binding_address(arg)
def handle_monitor_address(self, arg):
- self.monitor_family, self.monitor_address = parse_address(arg)
+ self.monitor_family, self.monitor_address = parse_binding_address(arg)
def handle_filename(self, arg):
from ZODB.config import FileStorage # That's a FileStorage *opener*!
Modified: ZODB/branches/3.4/src/ZEO/tests/testZEOOptions.py
===================================================================
--- ZODB/branches/3.4/src/ZEO/tests/testZEOOptions.py 2005-05-20 00:28:46 UTC (rev 30436)
+++ ZODB/branches/3.4/src/ZEO/tests/testZEOOptions.py 2005-05-20 00:57:18 UTC (rev 30437)
@@ -24,11 +24,9 @@
from ZEO.runzeo import ZEOOptions
from zdaemon.tests.testzdoptions import TestZDOptions
-# When a hostname isn't specified in an address, ZConfig supplies a
-# platform-dependent default value.
-DEFAULT_HOSTNAME = ''
-if sys.platform in ['win32',]:
- DEFAULT_HOSTNAME = 'localhost'
+# When a hostname isn't specified in a socket binding address, ZConfig
+# supplies the empty string.
+DEFAULT_BINDING_HOST = ""
class TestZEOOptions(TestZDOptions):
@@ -66,7 +64,7 @@
def test_defaults_with_schema(self):
options = self.OptionsClass()
options.realize(["-C", self.tempfilename])
- self.assertEqual(options.address, (DEFAULT_HOSTNAME, 5555))
+ self.assertEqual(options.address, (DEFAULT_BINDING_HOST, 5555))
self.assertEqual(len(options.storages), 1)
opener = options.storages[0]
self.assertEqual(opener.name, "fs")
@@ -78,7 +76,7 @@
def test_defaults_without_schema(self):
options = self.OptionsClass()
options.realize(["-a", "5555", "-f", "Data.fs"])
- self.assertEqual(options.address, (DEFAULT_HOSTNAME, 5555))
+ self.assertEqual(options.address, (DEFAULT_BINDING_HOST, 5555))
self.assertEqual(len(options.storages), 1)
opener = options.storages[0]
self.assertEqual(opener.name, "1")
@@ -92,7 +90,7 @@
options = self.OptionsClass()
options.realize(["-C", self.tempfilename,
"-a", "6666", "-f", "Wisdom.fs"])
- self.assertEqual(options.address, (DEFAULT_HOSTNAME, 6666))
+ self.assertEqual(options.address, (DEFAULT_BINDING_HOST, 6666))
self.assertEqual(len(options.storages), 1)
opener = options.storages[0]
self.assertEqual(opener.__class__, ZODB.config.FileStorage)
Modified: ZODB/branches/3.4/src/ZODB/config.py
===================================================================
--- ZODB/branches/3.4/src/ZODB/config.py 2005-05-20 00:28:46 UTC (rev 30436)
+++ ZODB/branches/3.4/src/ZODB/config.py 2005-05-20 00:57:18 UTC (rev 30437)
@@ -136,7 +136,7 @@
def open(self):
from ZEO.ClientStorage import ClientStorage
- # config.server is a multikey of socket-address values
+ # config.server is a multikey of socket-connection-address values
# where the value is a socket family, address tuple.
L = [server.address for server in self.config.server]
return ClientStorage(
More information about the Zodb-checkins
mailing list