diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-11-29 22:01:24 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-11-29 22:01:24 +0000 |
commit | dbc6686b5ea4129e7bc8e41dd7f8f8313c179fbd (patch) | |
tree | 0e1188cb6e5e63bae27bae7c789ad97ae1dd366d /swiftclient | |
parent | 0ef054585a93f80ba4bc72f953f832372e65db60 (diff) | |
parent | 9fe79a4aacfd47be6a1d92097c1d84ccd6763073 (diff) | |
download | python-swiftclient-dbc6686b5ea4129e7bc8e41dd7f8f8313c179fbd.tar.gz |
Merge "Add close to swiftclient.client.Connection"
Diffstat (limited to 'swiftclient')
-rw-r--r-- | swiftclient/client.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py index 8dc4b71..f8ba3d0 100644 --- a/swiftclient/client.py +++ b/swiftclient/client.py @@ -1072,6 +1072,14 @@ class Connection(object): self.insecure = insecure self.ssl_compression = ssl_compression + def close(self): + if self.http_conn and type(self.http_conn) is tuple\ + and len(self.http_conn) > 1: + conn = self.http_conn[1] + if hasattr(conn, 'close') and callable(conn.close): + conn.close() + self.http_conn = None + def get_auth(self): return get_auth(self.authurl, self.user, self.key, snet=self.snet, |