]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
remove object in wsgi LOG.info
authorZhi Kun Liu <zhikunli@cn.ibm.com>
Fri, 5 Sep 2014 08:51:30 +0000 (16:51 +0800)
committerMatt Riedemann <mriedem@us.ibm.com>
Fri, 5 Sep 2014 15:56:39 +0000 (08:56 -0700)
Method __init__ in Server class records log for wsgi server name, host
and port using its __dict__ which includes a socket object. i18n message
will deep copy each item's value in __dict__. In python2.6, deep copy
the socket object will raise "Exception RuntimeError" and can not be
caught. This makes cinder-api run into a hang loop. This patch uses the
related properties instead of __dict__ object to fix the problem.

Closes-Bug: #1365901
Change-Id: Ia6ac51f4849d369c54ac88b1587741a2d2beb40b

cinder/wsgi.py

index fb9a9b8a2e48ce044178c5b00040d96a3e67de8d..81533a6bb2d597c8125c1f6e095a52a5cb0a756c 100644 (file)
@@ -174,8 +174,8 @@ class Server(object):
                                {'host': host, 'port': port})
 
         (self._host, self._port) = self._socket.getsockname()[0:2]
-        LOG.info(_("%(name)s listening on %(_host)s:%(_port)s")
-                 % self.__dict__)
+        LOG.info(_("%(name)s listening on %(_host)s:%(_port)s") %
+                 {'name': self.name, '_host': self._host, '_port': self._port})
 
     def start(self):
         """Start serving a WSGI application.