diff --git a/ipaclient/remote_plugins/__init__.py b/ipaclient/remote_plugins/__init__.py index dff445b33..dcd441a29 100644 --- a/ipaclient/remote_plugins/__init__.py +++ b/ipaclient/remote_plugins/__init__.py @@ -2,6 +2,7 @@ # Copyright (C) 2016 FreeIPA Contributors see COPYING for license # +from collections.abc import MutableMapping import errno import json import locale @@ -9,21 +10,12 @@ import logging import os import time -import six - from . import compat from . import schema from ipaclient.plugins.rpcclient import rpcclient from ipalib.constants import USER_CACHE_PATH from ipapython.dnsutil import DNSName -# pylint: disable=no-name-in-module, import-error -if six.PY3: - from collections.abc import MutableMapping -else: - from collections import MutableMapping -# pylint: enable=no-name-in-module, import-error - logger = logging.getLogger(__name__) diff --git a/ipaclient/remote_plugins/schema.py b/ipaclient/remote_plugins/schema.py index db39d8be6..4dcdad4ca 100644 --- a/ipaclient/remote_plugins/schema.py +++ b/ipaclient/remote_plugins/schema.py @@ -2,6 +2,7 @@ # Copyright (C) 2016 FreeIPA Contributors see COPYING for license # +from collections.abc import Mapping, Sequence import errno import json import logging @@ -27,13 +28,6 @@ from ipapython.ipautil import fsdecode from ipapython.dn import DN from ipapython.dnsutil import DNSName -# pylint: disable=no-name-in-module, import-error -if six.PY3: - from collections.abc import Mapping, Sequence -else: - from collections import Mapping, Sequence -# pylint: enable=no-name-in-module, import-error - logger = logging.getLogger(__name__) FORMAT = '1' diff --git a/ipalib/plugable.py b/ipalib/plugable.py index f5d141fb9..8e53fec2e 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -25,6 +25,7 @@ you are unfamiliar with this Python feature, see http://docs.python.org/ref/sequence-types.html """ +from collections.abc import Mapping import logging import operator import re @@ -51,13 +52,6 @@ from ipapython.ipa_log_manager import ( LOGGING_FORMAT_STDERR) from ipapython.version import VERSION, API_VERSION, DEFAULT_PLUGINS -# pylint: disable=no-name-in-module, import-error -if six.PY3: - from collections.abc import Mapping -else: - from collections import Mapping -# pylint: enable=no-name-in-module, import-error - if six.PY3: unicode = str diff --git a/ipaplatform/base/services.py b/ipaplatform/base/services.py index 53c64a1cd..466390332 100644 --- a/ipaplatform/base/services.py +++ b/ipaplatform/base/services.py @@ -37,12 +37,7 @@ from ipapython import ipautil from ipaplatform.paths import paths from ipaplatform.tasks import tasks -# pylint: disable=no-name-in-module, import-error -if six.PY3: - from collections.abc import Mapping -else: - from collections import Mapping -# pylint: enable=no-name-in-module, import-error +from collections.abc import Mapping logger = logging.getLogger(__name__) diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py index 459f91146..e64847b6a 100644 --- a/ipapython/ipaldap.py +++ b/ipapython/ipaldap.py @@ -53,12 +53,7 @@ from ipapython.dn import DN, RDN from ipapython.dnsutil import DNSName from ipapython.kerberos import Principal -# pylint: disable=no-name-in-module, import-error -if six.PY3: - from collections.abc import MutableMapping -else: - from collections import MutableMapping -# pylint: enable=no-name-in-module, import-error +from collections.abc import MutableMapping if six.PY3: unicode = str diff --git a/ipaserver/dnssec/ldapkeydb.py b/ipaserver/dnssec/ldapkeydb.py index d47b03732..084af03a0 100644 --- a/ipaserver/dnssec/ldapkeydb.py +++ b/ipaserver/dnssec/ldapkeydb.py @@ -5,11 +5,10 @@ from __future__ import print_function, absolute_import from binascii import hexlify +from collections.abc import MutableMapping import logging from pprint import pprint -import six - import ipalib from ipaplatform.paths import paths from ipapython.dn import DN @@ -24,13 +23,6 @@ from ipaserver.dnssec.abshsm import ( from ipaserver import p11helper as _ipap11helper import uuid -# pylint: disable=no-name-in-module, import-error -if six.PY3: - from collections.abc import MutableMapping -else: - from collections import MutableMapping -# pylint: enable=no-name-in-module, import-error - logger = logging.getLogger(__name__) diff --git a/ipaserver/dnssec/localhsm.py b/ipaserver/dnssec/localhsm.py index d02fdbe14..d6500a1f8 100644 --- a/ipaserver/dnssec/localhsm.py +++ b/ipaserver/dnssec/localhsm.py @@ -4,11 +4,10 @@ from __future__ import print_function, absolute_import +from collections.abc import MutableMapping import os from pprint import pprint -import six - from ipalib.constants import SOFTHSM_DNSSEC_TOKEN_LABEL from ipaplatform.paths import paths from ipaserver import p11helper as _ipap11helper @@ -17,13 +16,6 @@ from ipaserver.dnssec.abshsm import (attrs_name2id, attrs_id2name, AbstractHSM, ldap2p11helper_api_params) from ipaserver.dnssec.ldapkeydb import str_hexlify -# pylint: disable=no-name-in-module, import-error -if six.PY3: - from collections.abc import MutableMapping -else: - from collections import MutableMapping -# pylint: enable=no-name-in-module, import-error - private_key_api_params = set(["label", "id", "data", "unwrapping_key", "wrapping_mech", "key_type", "cka_always_authenticate", "cka_copyable", diff --git a/ipatests/test_xmlrpc/xmlrpc_test.py b/ipatests/test_xmlrpc/xmlrpc_test.py index 8adb3c0d7..83c5b2ce8 100644 --- a/ipatests/test_xmlrpc/xmlrpc_test.py +++ b/ipatests/test_xmlrpc/xmlrpc_test.py @@ -22,24 +22,17 @@ Base class for all XML-RPC tests """ from __future__ import print_function +from collections.abc import Sequence import datetime import inspect import contextlib import pytest -import six from ipatests.util import assert_deepequal, Fuzzy from ipalib import api, request as ipa_request, errors from ipapython.version import API_VERSION -# pylint: disable=no-name-in-module, import-error -if six.PY3: - from collections.abc import Sequence -else: - from collections import Sequence -# pylint: enable=no-name-in-module, import-error - # Matches a gidnumber like '1391016742' # FIXME: Does it make more sense to return gidnumber, uidnumber, etc. as `int` # or `long`? If not, we still need to return them as `unicode` instead of `str`.