mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipapython.nsslib, ipalib.rpc: Remove code for Python 2.6 and below
IPA hasn't supported these pythons for a while now. Reviewed-By: Tomas Babej <tbabej@redhat.com>
This commit is contained in:
parent
beb6a3236d
commit
4ddd1821b6
@ -480,10 +480,7 @@ class SSLTransport(LanguageAwareTransport):
|
||||
|
||||
def make_connection(self, 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
|
||||
|
||||
if sys.version_info >= (2, 7):
|
||||
if self._connection and host == self._connection[0]:
|
||||
return self._connection[1]
|
||||
|
||||
@ -500,18 +497,13 @@ class SSLTransport(LanguageAwareTransport):
|
||||
# need to re-initialize.
|
||||
no_init = dbdir == ipapython.nsslib.current_dbdir
|
||||
|
||||
if sys.version_info < (2, 7):
|
||||
conn = NSSHTTPS(host, 443, dbdir=dbdir, no_init=no_init)
|
||||
else:
|
||||
conn = NSSConnection(host, 443, dbdir=dbdir, no_init=no_init,
|
||||
tls_version_min=api.env.tls_version_min,
|
||||
tls_version_max=api.env.tls_version_max)
|
||||
self.dbdir=dbdir
|
||||
|
||||
conn.connect()
|
||||
if sys.version_info < (2, 7):
|
||||
return conn
|
||||
else:
|
||||
|
||||
self._connection = host, conn
|
||||
return self._connection[1]
|
||||
|
||||
@ -925,7 +917,6 @@ class RPCClient(Connectible):
|
||||
return serverproxy
|
||||
|
||||
def destroy_connection(self):
|
||||
if sys.version_info >= (2, 7):
|
||||
conn = getattr(context, self.id, None)
|
||||
if conn is not None:
|
||||
conn = conn.conn._ServerProxy__transport
|
||||
|
@ -291,12 +291,6 @@ class NSSConnection(httplib.HTTPConnection, NSSAddressFamilyFallback):
|
||||
"""
|
||||
try:
|
||||
# FIXME: httplib uses old-style classes so super doesn't work
|
||||
# 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 as e:
|
||||
self.close()
|
||||
|
Loading…
Reference in New Issue
Block a user