]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Big Switch: Check source_address attribute exists
authorKevin Benton <blak111@gmail.com>
Tue, 6 May 2014 01:57:46 +0000 (18:57 -0700)
committerKevin Benton <blak111@gmail.com>
Tue, 6 May 2014 01:59:18 +0000 (18:59 -0700)
Check that the source_address attribute exists on
HTTPSConnection objects before referencing it since
it's not present on python 2.6 deployments.

Closes-Bug: #1316382
Change-Id: Id82e70f124cba73c33737099027b5c61aea713bb

neutron/plugins/bigswitch/servermanager.py

index 8792290af6cf8582184f805031a8fe634e6cfe63..79eb5e776f14a760df3855f33ca5d34a0b5318e4 100644 (file)
@@ -566,8 +566,8 @@ class HTTPSConnectionWithValidation(httplib.HTTPSConnection):
     combined_cert = None
 
     def connect(self):
-        sock = socket.create_connection((self.host, self.port),
-                                        self.timeout, self.source_address)
+        sock = socket.create_connection((self.host, self.port), self.timeout,
+                                        getattr(self, 'source_address', None))
         if self._tunnel_host:
             self.sock = sock
             self._tunnel()