From: Kevin Benton Date: Tue, 6 May 2014 01:57:46 +0000 (-0700) Subject: Big Switch: Check source_address attribute exists X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=0dde14c0cd6ffea8ebff715342852ef17a9c0b70;p=openstack-build%2Fneutron-build.git Big Switch: Check source_address attribute exists 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 --- diff --git a/neutron/plugins/bigswitch/servermanager.py b/neutron/plugins/bigswitch/servermanager.py index 8792290af..79eb5e776 100644 --- a/neutron/plugins/bigswitch/servermanager.py +++ b/neutron/plugins/bigswitch/servermanager.py @@ -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()