summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2012-10-17 16:58:54 -0400
committerRob Crittenden <rcritten@redhat.com>2012-10-24 15:07:53 -0400
commitfb7575d6b77c1d85539c8e71b7fa931e758704d3 (patch)
treed876198c0b025085625f0f84dfd8a665a458f960 /ipapython
parent445744206b92787e82057ca56062076ccf9d7dfe (diff)
downloadfreeipa-fb7575d6b77c1d85539c8e71b7fa931e758704d3.tar.gz
freeipa-fb7575d6b77c1d85539c8e71b7fa931e758704d3.tar.xz
freeipa-fb7575d6b77c1d85539c8e71b7fa931e758704d3.zip
Close connection after each request, avoid NSS shutdown problem.
The unit tests were failing when executed against an Apache server in F-18 due to dangling references causing NSS shutdown to fail. https://fedorahosted.org/freeipa/ticket/3180
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/nsslib.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ipapython/nsslib.py b/ipapython/nsslib.py
index 06bcba648..7afccd568 100644
--- a/ipapython/nsslib.py
+++ b/ipapython/nsslib.py
@@ -238,6 +238,12 @@ class NSSConnection(httplib.HTTPConnection, NSSAddressFamilyFallback):
def connect(self):
self.connect_socket(self.host, self.port)
+ def close(self):
+ """Close the connection to the HTTP server."""
+ if self.sock:
+ self.sock.close() # close it manually... there may be other refs
+ self.sock = None
+
def endheaders(self, message=None):
"""
Explicitly close the connection if an error is returned after the