[Zope-Checkins] SVN: Zope/branches/2.12/ - LP #143533: Instead of showing "0.0.0.0" as server name when no

Jens Vagelpohl jens at dataflake.org
Wed Jul 14 10:19:15 EDT 2010


Log message for revision 114741:
  - LP #143533: Instead of showing "0.0.0.0" as server name when no
    specific listening IP is configured for the HTTP server, do a
    socket lookup to show the current server's fully qualified name.
  

Changed:
  U   Zope/branches/2.12/doc/CHANGES.rst
  U   Zope/branches/2.12/src/ZServer/HTTPServer.py

-=-
Modified: Zope/branches/2.12/doc/CHANGES.rst
===================================================================
--- Zope/branches/2.12/doc/CHANGES.rst	2010-07-14 14:17:45 UTC (rev 114740)
+++ Zope/branches/2.12/doc/CHANGES.rst	2010-07-14 14:19:15 UTC (rev 114741)
@@ -11,6 +11,10 @@
 Bugs Fixed
 ++++++++++
 
+- LP #143533: Instead of showing "0.0.0.0" as server name when no
+  specific listening IP is configured for the HTTP server, do a 
+  socket lookup to show the current server's fully qualified name.
+
 - LP #143722: Added missing permission to ObjectManager.manage_hasId,
   which prevented renaming files and folders via FTP.
 

Modified: Zope/branches/2.12/src/ZServer/HTTPServer.py
===================================================================
--- Zope/branches/2.12/src/ZServer/HTTPServer.py	2010-07-14 14:17:45 UTC (rev 114740)
+++ Zope/branches/2.12/src/ZServer/HTTPServer.py	2010-07-14 14:19:15 UTC (rev 114741)
@@ -447,6 +447,12 @@
         self.shutup=1
         self.fast_listen = fast_listen
         http_server.__init__(self, ip, port, resolver, logger_object)
+        if self.server_name == '0.0.0.0':
+            # Workaround to set a more descriptive server_name
+            try:
+                self.server_name = socket.getfqdn()
+            except socket.error:
+                pass
         self.shutup=0
         self.log_info('%s server started at %s\n'
                       '\tHostname: %s\n\tPort: %d' % (



More information about the Zope-Checkins mailing list