pylint: enable the import-error check

Check for import errors with pylint to make sure new python package
dependencies are not overlooked.

https://fedorahosted.org/freeipa/ticket/6418

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Jan Cholasta 2016-08-24 13:37:30 +02:00 committed by David Kupka
parent 1077743d90
commit 0d370a959b
30 changed files with 76 additions and 25 deletions

View File

@ -30,7 +30,9 @@ import tempfile
import gssapi
import SSSDConfig
# pylint: disable=import-error
from six.moves.urllib.parse import urlsplit
# pylint: enable=import-error
from optparse import OptionParser
from ipalib import api, errors

View File

@ -25,7 +25,10 @@ from __future__ import print_function
import operator
import re
from urllib.request import urlopen # pylint: disable=no-name-in-module
# pylint: disable=import-error,no-name-in-module
from urllib.request import urlopen
# pylint: enable=import-error,no-name-in-module
SOURCE = "https://git.fedorahosted.org/cgit/mod_nss.git/plain/nss_engine_cipher.c"

View File

@ -28,7 +28,10 @@ import ldap
import socket
import traceback
# pylint: disable=import-error
from six.moves.urllib.parse import urlparse
from six.moves.xmlrpc_client import MAXINT
# pylint: enable=import-error
from ipapython import ipautil
from ipaserver.install import replication, dsinstance, installutils
@ -42,7 +45,6 @@ from ipapython.ipa_log_manager import root_logger, standard_logging_setup
from ipapython.dn import DN
from ipapython.config import IPAOptionParser
from ipaclient import ipadiscovery
from six.moves.xmlrpc_client import MAXINT
from ipaplatform.paths import paths
# dict of command name and tuples of min/max num of args needed

View File

@ -21,7 +21,9 @@ import os
import tempfile
import shutil
# pylint: disable=import-error
from six.moves.urllib.parse import urlsplit
# pylint: enable=import-error
from ipapython import (admintool, ipautil, ipaldap, sysrestore, certmonger,
certdb)

View File

@ -34,8 +34,10 @@ from os import path
import sys
import six
# pylint: disable=import-error
from six.moves.urllib.parse import urlparse, urlunparse
from six.moves.configparser import RawConfigParser, ParsingError
# pylint: enable=import-error
from ipapython.dn import DN
from ipalib.base import check_name

View File

@ -103,9 +103,11 @@ import re
import decimal
import base64
import datetime
from six.moves.xmlrpc_client import MAXINT, MININT
import six
# pylint: disable=import-error
from six.moves.xmlrpc_client import MAXINT, MININT
# pylint: enable=import-error
from ipalib.text import _ as ugettext
from ipalib.base import check_name

View File

@ -76,6 +76,7 @@ try:
from xmlrpclib import (Binary, Fault, DateTime, dumps, loads, ServerProxy,
Transport, ProtocolError, MININT, MAXINT)
except ImportError:
# pylint: disable=import-error
from xmlrpc.client import (Binary, Fault, DateTime, dumps, loads, ServerProxy,
Transport, ProtocolError, MININT, MAXINT)

View File

@ -22,12 +22,14 @@ from copy import copy
from dns import resolver, rdatatype
from dns.exception import DNSException
# pylint: disable=import-error
from six.moves.configparser import SafeConfigParser
from six.moves.urllib.parse import urlsplit
# pylint: enable=import-error
from ipapython.dn import DN
from ipaplatform.paths import paths
import dns.name
from six.moves.urllib.parse import urlsplit
import socket

View File

@ -23,7 +23,9 @@ import email.utils
from calendar import timegm
import six
# pylint: disable=import-error
from six.moves.urllib.parse import urlparse
# pylint: enable=import-error
from ipapython.ipa_log_manager import log_mgr

View File

@ -22,7 +22,9 @@ import xml.dom.minidom
import nss.nss as nss
import six
# pylint: disable=import-error
from six.moves.urllib.parse import urlencode
# pylint: enable=import-error
from ipalib import api, errors
from ipalib.errors import NetworkError
@ -35,6 +37,7 @@ from ipapython.ipa_log_manager import root_logger
try:
import httplib
except ImportError:
# pylint: disable=import-error
import http.client as httplib
if six.PY3:

View File

@ -35,6 +35,7 @@ import nss.error as error
try:
import httplib
except ImportError:
# pylint: disable=import-error
import http.client as httplib
# NSS database currently open

View File

@ -2,8 +2,12 @@
from __future__ import print_function
import os
from ipaplatform.paths import paths
# pylint: disable=import-error
from six.moves.configparser import ConfigParser
# pylint: enable=import-error
from ipaplatform.paths import paths
from ipapython.dn import DN
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization

View File

@ -30,7 +30,9 @@ from ipapython.ipa_log_manager import root_logger
import random
import six
# pylint: disable=import-error
from six.moves.configparser import SafeConfigParser
# pylint: enable=import-error
from ipaplatform.tasks import tasks
from ipaplatform.paths import paths

View File

@ -44,12 +44,6 @@ import samba
import random
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms
from cryptography.hazmat.backends import default_backend
# pylint: disable=F0401
try:
from ldap.controls import RequestControl as LDAPControl
except ImportError:
from ldap.controls import LDAPControl as LDAPControl
# pylint: enable=F0401
import ldap as _ldap
from ipapython.ipaldap import IPAdmin
from ipaserver.session import krbccache_dir, krbccache_prefix
@ -63,6 +57,11 @@ from ipaplatform.paths import paths
from ldap.filter import escape_filter_chars
from time import sleep
try:
from ldap.controls import RequestControl as LDAPControl
except ImportError:
from ldap.controls import LDAPControl as LDAPControl
if six.PY3:
unicode = str
long = int

View File

@ -39,8 +39,10 @@ import xml.dom.minidom
import shlex
import pipes
# pylint: disable=import-error
from six.moves import urllib
from six.moves.configparser import ConfigParser, RawConfigParser
# pylint: enable=import-error
from ipalib import api
from ipalib import pkcs10, x509
@ -79,6 +81,7 @@ from ipaserver.plugins import ldap2
try:
import httplib
except ImportError:
# pylint: disable=import-error
import http.client as httplib
# We need to reset the template because the CA uses the regular boot

View File

@ -40,7 +40,9 @@ from dns.exception import DNSException
import ldap
import ldapurl
import six
# pylint: disable=import-error
from six.moves.configparser import SafeConfigParser, NoOptionError
# pylint: enable=import-error
import ipaplatform

View File

@ -22,11 +22,13 @@ import shutil
import tempfile
import time
import pwd
# pylint: disable=import-error
from six.moves.configparser import SafeConfigParser
# pylint: enable=import-error
from ipaplatform.paths import paths
from ipaplatform import services
from six.moves.configparser import SafeConfigParser
from ipalib import api, errors
from ipapython import version
from ipapython.ipautil import run, write_tmp_file

View File

@ -28,7 +28,9 @@ import time
from optparse import OptionGroup, SUPPRESS_HELP
import dns.resolver
# pylint: disable=import-error
from six.moves.configparser import SafeConfigParser
# pylint: enable=import-error
from ipaserver.install import certs, installutils, bindinstance, dsinstance
from ipaserver.install.replication import enable_replication_version_checking

View File

@ -25,7 +25,9 @@ import pwd
import ldif
import itertools
# pylint: disable=import-error
from six.moves.configparser import SafeConfigParser
# pylint: enable=import-error
from ipalib import api, errors
from ipalib.constants import FQDN

View File

@ -22,7 +22,9 @@ import pwd
import shutil
import tempfile
# pylint: disable=import-error
from six.moves.configparser import ConfigParser
# pylint: enable=import-error
from ipalib import api
from ipalib import x509

View File

@ -14,7 +14,9 @@ import sys
import dns.exception
import six
# pylint: disable=import-error
from six.moves.configparser import SafeConfigParser
# pylint: enable=import-error
from ipalib import api
import SSSDConfig

View File

@ -39,7 +39,7 @@ from ipapython.ipaldap import (LDAPClient, AUTOBIND_AUTO, AUTOBIND_ENABLED,
try:
from ldap.controls.simple import GetEffectiveRightsControl #pylint: disable=F0401,E0611
from ldap.controls.simple import GetEffectiveRightsControl
except ImportError:
"""
python-ldap 2.4.x introduced a new API for effective rights control, which

View File

@ -49,20 +49,20 @@ if six.PY3:
unicode = str
try:
import pysss_murmur #pylint: disable=F0401
import pysss_murmur
_murmur_installed = True
except Exception as e:
_murmur_installed = False
try:
import pysss_nss_idmap #pylint: disable=F0401
import pysss_nss_idmap
_nss_idmap_installed = True
except Exception as e:
_nss_idmap_installed = False
if api.env.in_server and api.env.context in ['lite', 'server']:
try:
import ipaserver.dcerpc # pylint: disable=F0401
import ipaserver.dcerpc
from ipaserver.dcerpc import (TRUST_ONEWAY,
TRUST_BIDIRECTIONAL,
TRUST_JOIN_EXTERNAL)

View File

@ -24,7 +24,6 @@ Also see the `ipalib.rpc` module.
"""
from xml.sax.saxutils import escape
from six.moves.xmlrpc_client import Fault
import os
import datetime
import json
@ -36,7 +35,10 @@ import ldap.controls
from pyasn1.type import univ, namedtype
from pyasn1.codec.ber import encoder
import six
# pylint: disable=import-error
from six.moves.urllib.parse import parse_qs
from six.moves.xmlrpc_client import Fault
# pylint: enable=import-error
from ipalib import plugable, errors
from ipalib.capabilities import VERSION_WITHOUT_CAPABILITIES

View File

@ -22,7 +22,9 @@ import os
import re
import time
# pylint: disable=import-error
from six.moves.urllib.parse import urlparse
# pylint: enable=import-error
from ipalib import errors
from ipalib.text import _

View File

@ -30,10 +30,12 @@ import re
import sys
from decimal import Decimal
from inspect import isclass
from six.moves.xmlrpc_client import MAXINT, MININT
import pytest
import six
# pylint: disable=import-error
from six.moves.xmlrpc_client import MAXINT, MININT
# pylint: enable=import-error
from ipatests.util import raises, ClassChecker, read_only
from ipatests.util import dummy_ugettext, assert_equal

View File

@ -22,10 +22,11 @@ Test the `ipalib.rpc` module.
"""
from __future__ import print_function
from six.moves.xmlrpc_client import Binary, Fault, dumps, loads
import nose
import six
# pylint: disable=import-error
from six.moves.xmlrpc_client import Binary, Fault, dumps, loads
# pylint: enable=import-error
from ipatests.util import raises, assert_equal, PluginTester, DummyClass
from ipatests.data import binary_bytes, utf8_bytes, unicode_str

View File

@ -29,6 +29,7 @@ from ipalib import api
try:
import httplib
except ImportError:
# pylint: disable=import-error
import http.client as httplib
class Unauthorized_HTTP_test(object):

View File

@ -32,6 +32,10 @@ import os
from functools import wraps
from nose.plugins.skip import SkipTest
# pylint: disable=import-error
from six.moves.urllib.error import URLError
# pylint: enable=import-error
try:
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
@ -53,7 +57,6 @@ try:
NO_YAML = False
except ImportError:
NO_YAML = True
from six.moves.urllib.error import URLError
from ipaplatform.paths import paths
ENV_MAP = {

View File

@ -18,7 +18,6 @@ enable=
disable=
I,
duplicate-code,
import-error,
interface-not-implemented,
no-self-use,
redefined-variable-type,
@ -33,7 +32,6 @@ disable=
too-many-public-methods,
too-many-return-statements,
too-many-statements,
import-error,
abstract-method,
anomalous-backslash-in-string,
arguments-differ,