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 /ipalib/rpc.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 'ipalib/rpc.py')
-rw-r--r-- | ipalib/rpc.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ipalib/rpc.py b/ipalib/rpc.py index 472e0628b..4c2cf94e8 100644 --- a/ipalib/rpc.py +++ b/ipalib/rpc.py @@ -32,6 +32,7 @@ Also see the `ipaserver.rpcserver` module. from types import NoneType import threading +import sys import os import errno from xmlrpclib import Binary, Fault, dumps, loads, ServerProxy, Transport, ProtocolError @@ -42,7 +43,7 @@ from ipalib import errors from ipalib.request import context from ipapython import ipautil, dnsclient import httplib -from ipapython.nsslib import NSSHTTPS +from ipapython.nsslib import NSSHTTPS, NSSConnection from nss.error import NSPRError from urllib2 import urlparse @@ -192,8 +193,15 @@ class SSLTransport(Transport): """Handles an HTTPS transaction to an XML-RPC server.""" def make_connection(self, host): - host, extra_headers, x509 = self.get_host_info(host) - conn = NSSHTTPS(host, 443, dbdir="/etc/pki/nssdb") + host, self._extra_headers, x509 = self.get_host_info(host) + host, self._extra_headers, x509 = self.get_host_info(host) + # Python 2.7 changed the internal class used in xmlrpclib from + # HTTP to HTTPConnection. We need to use the proper subclass + (major, minor, micro, releaselevel, serial) = sys.version_info + if major == 2 and minor < 7: + conn = NSSHTTPS(host, 443, dbdir="/etc/pki/nssdb") + else: + conn = NSSConnection(host, 443, dbdir="/etc/pki/nssdb") conn.connect() return conn |