[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup - datatypes.py:1.2.2.7 handlers.py:1.2.2.11 zopeschema.xml:1.2.2.10

Fred L. Drake, Jr. fred@zope.com
Tue, 25 Feb 2003 15:51:07 -0500


Update of /cvs-repository/Zope/lib/python/Zope/Startup
In directory cvs.zope.org:/tmp/cvs-serv5647/lib/python/Zope/Startup

Modified Files:
      Tag: new-install-branch
	datatypes.py handlers.py zopeschema.xml 
Log Message:
Make the DNS resolver a configuration datatype; this needs less code than
converting an IP address/hostname after loading the configuration, and the
resolver becomes available to other components via the App.config module.


=== Zope/lib/python/Zope/Startup/datatypes.py 1.2.2.6 => 1.2.2.7 ===
--- Zope/lib/python/Zope/Startup/datatypes.py:1.2.2.6	Mon Feb 24 16:13:06 2003
+++ Zope/lib/python/Zope/Startup/datatypes.py	Tue Feb 25 15:50:36 2003
@@ -64,6 +64,13 @@
             self.resolved = logger
         return self.resolved
 
+# DNS resolver
+
+def dns_resolver(hostname):
+    from ZServer.medusa import resolver
+    return resolver.caching_resolver(hostname)
+    
+
 # Datatype for the root configuration object
 # (adds the softwarehome and zopehome fields; default values for some
 #  computed paths)


=== Zope/lib/python/Zope/Startup/handlers.py 1.2.2.10 => 1.2.2.11 ===
--- Zope/lib/python/Zope/Startup/handlers.py:1.2.2.10	Mon Feb 24 17:29:26 2003
+++ Zope/lib/python/Zope/Startup/handlers.py	Tue Feb 25 15:50:36 2003
@@ -109,17 +109,10 @@
             ZServer.datatypes.FTPServerFactory(_DummyServerConfig(21)),
             ]
 
-    # create the DNS resolver:
-    if config.dns_ip_address:
-        from ZServer.medusa import resolver
-        dnsresolver = resolver.caching_resolver(config.dns_ip_address)
-    else:
-        dnsresolver = None
-
     # prepare servers:
     for factory in config.servers:
         factory.prepare(config.ip_address or '',
-                        dnsresolver,
+                        config.dns_resolver,
                         "Zope",
                         config.cgi_environment or {},
                         config.port_base)


=== Zope/lib/python/Zope/Startup/zopeschema.xml 1.2.2.9 => 1.2.2.10 ===
--- Zope/lib/python/Zope/Startup/zopeschema.xml:1.2.2.9	Mon Feb 24 15:15:41 2003
+++ Zope/lib/python/Zope/Startup/zopeschema.xml	Tue Feb 25 15:50:36 2003
@@ -93,7 +93,7 @@
 
   <section type="cgi-environment" attribute="cgi_environment" name="*"/>
 
-  <key name="dns-ip-address" datatype="ipaddr-or-hostname"/>
+  <key name="dns-server" datatype=".dns_resolver" attribute="dns_resolver"/>
 
   <key name="ip-address" datatype="ipaddr-or-hostname"/>