diff options
author | Rob Crittenden <rcritten@redhat.com> | 2010-08-31 16:59:27 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-08-31 16:59:27 -0400 |
commit | d0ea0bb63891babd1c5778df2e291b527c8e927c (patch) | |
tree | ecbc0c15a5e86da0fc4b7c049ebe2a0c420f516f /ipapython/nsslib.py | |
parent | e05400dad83adabe09e57e9eb04b718c01019e32 (diff) | |
download | freeipa-d0ea0bb63891babd1c5778df2e291b527c8e927c.tar.gz freeipa-d0ea0bb63891babd1c5778df2e291b527c8e927c.tar.xz freeipa-d0ea0bb63891babd1c5778df2e291b527c8e927c.zip |
Changes to fix compatibility with Fedora 14
Fedora 14 introduced the following incompatiblities:
- the kerberos binaries moved from /usr/kerberos/[s]/bin to /usr/[s]bin
- the xmlrpclib in Python 2.7 is not fully backwards compatible to 2.6
Also, when moving the installed host service principals:
- don't assume that krbticketflags is set
- allow multiple values for krbextradata
ticket 155
Diffstat (limited to 'ipapython/nsslib.py')
-rw-r--r-- | ipapython/nsslib.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ipapython/nsslib.py b/ipapython/nsslib.py index f7891768f..9593dd1c4 100644 --- a/ipapython/nsslib.py +++ b/ipapython/nsslib.py @@ -18,6 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +import sys import httplib import getpass import logging @@ -161,7 +162,7 @@ class NSSConnection(httplib.HTTPConnection): logging.debug("connect: %s", net_addr) self.sock.connect(net_addr) - def endheaders(self): + def endheaders(self, message=None): """ Explicitly close the connection if an error is returned after the headers are sent. This will likely mean the initial SSL handshake @@ -170,7 +171,13 @@ class NSSConnection(httplib.HTTPConnection): """ try: # FIXME: httplib uses old-style classes so super doesn't work - httplib.HTTPConnection.endheaders(self) + # Python 2.7 changed the API for endheaders. This is an attempt + # to work across versions + (major, minor, micro, releaselevel, serial) = sys.version_info + if major == 2 and minor < 7: + httplib.HTTPConnection.endheaders(self) + else: + httplib.HTTPConnection.endheaders(self, message) except NSPRError, e: self.close() raise e |