pylint: Fix deprecated-class

There is no actual usage of deprecated classes for Python3.
Pylint complains about such for Python2. Since Python2 is no
longer supported these imports were removed.

Fixes: https://pagure.io/freeipa/issue/9117
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Stanislav Levin authored and Rob Crittenden committed 2022-03-14 10:44:55 -04:00
1 parent 0ebf09e061
commit ccf9334da9
8 files changed
+8 -61

No files matched your search

+1 -9
View File
@@ -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__)
+1 -7
View File
@@ -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'
+1 -7
View File
@@ -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
+1 -6
View File
@@ -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__)
+1 -6
View File
@@ -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
+1 -9
View File
@@ -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__)
+1 -9
View File
@@ -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",
+1 -8
View File
@@ -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`.