diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-10-20 19:01:23 +0200 |
---|---|---|
committer | Tomas Babej <tbabej@redhat.com> | 2015-10-27 17:23:25 +0100 |
commit | 4ddd1821b6c8556c79c202d8a9df19c576202ec1 (patch) | |
tree | 5ce828a73865c10ec72160028eadaeb338a72bfc /ipalib/rpc.py | |
parent | beb6a3236d5c10acd990aaf92eddc74fee456909 (diff) | |
download | freeipa-4ddd1821b6c8556c79c202d8a9df19c576202ec1.tar.gz freeipa-4ddd1821b6c8556c79c202d8a9df19c576202ec1.tar.xz freeipa-4ddd1821b6c8556c79c202d8a9df19c576202ec1.zip |
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>
Diffstat (limited to 'ipalib/rpc.py')
-rw-r--r-- | ipalib/rpc.py | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/ipalib/rpc.py b/ipalib/rpc.py index 6a7f6982b..02281d404 100644 --- a/ipalib/rpc.py +++ b/ipalib/rpc.py @@ -480,12 +480,9 @@ 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] + if self._connection and host == self._connection[0]: + return self._connection[1] dbdir = getattr(context, 'nss_dir', paths.IPA_NSSDB_DIR) connection_dbdir = self.get_connection_dbdir() @@ -500,20 +497,15 @@ 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) + 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] + + self._connection = host, conn + return self._connection[1] class KerbTransport(SSLTransport): @@ -925,11 +917,10 @@ 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 - conn.close() + conn = getattr(context, self.id, None) + if conn is not None: + conn = conn.conn._ServerProxy__transport + conn.close() def _call_command(self, command, params): """Call the command with given params""" |