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:08:03 -0400
commit4941915154e64256c48a2b44a0e3ee9954f43782 (patch)
tree0af8cdcf0e16ad50fb80c9578771dc24d859e914 /ipapython
parent1f81fe68aba37ef5992920d43e337aca197a6022 (diff)
downloadfreeipa.git-4941915154e64256c48a2b44a0e3ee9954f43782.tar.gz
freeipa.git-4941915154e64256c48a2b44a0e3ee9954f43782.tar.xz
freeipa.git-4941915154e64256c48a2b44a0e3ee9954f43782.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 06bcba64..7afccd56 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