summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2015-12-16 16:06:03 +0100
committerJan Cholasta <jcholast@redhat.com>2015-12-23 07:59:22 +0100
commite4075b1fe26a608cd1f3778ee1f655a5f5700c65 (patch)
tree11529085e2b884007068a14ea1fa3ed33d62103c
parent774d0eaa8eb940ea9c42c4ef12eb80e509fd9c3b (diff)
downloadfreeipa-e4075b1fe26a608cd1f3778ee1f655a5f5700c65.tar.gz
freeipa-e4075b1fe26a608cd1f3778ee1f655a5f5700c65.tar.xz
freeipa-e4075b1fe26a608cd1f3778ee1f655a5f5700c65.zip
Remove unused imports
This patch removes unused imports, alse pylint has been configured to check unused imports. Reviewed-By: Jan Cholasta <jcholast@redhat.com>
-rwxr-xr-xchecks/check-ra.py2
-rw-r--r--contrib/RHEL4/ipa-client-setup1
-rw-r--r--contrib/RHEL4/ipachangeconf.py2
-rw-r--r--contrib/RHEL4/setup.py1
-rwxr-xr-xdaemons/dnssec/ipa-dnskeysync-replica10
-rwxr-xr-xdaemons/dnssec/ipa-dnskeysyncd2
-rwxr-xr-xdaemons/dnssec/ipa-ods-exporter4
-rw-r--r--doc/examples/examples.py3
-rw-r--r--install/migration/migration.py2
-rw-r--r--install/restart_scripts/stop_pkicad1
-rwxr-xr-xinstall/share/copy-schema-to-ca.py2
-rwxr-xr-xinstall/tools/ipa-adtrust-install1
-rwxr-xr-xinstall/tools/ipa-compat-manage2
-rwxr-xr-xinstall/tools/ipa-csreplica-manage2
-rwxr-xr-xinstall/tools/ipa-dns-install2
-rwxr-xr-xinstall/tools/ipa-managed-entries2
-rwxr-xr-xinstall/tools/ipa-nis-manage2
-rwxr-xr-xinstall/tools/ipa-otptoken-import1
-rwxr-xr-xinstall/tools/ipa-replica-conncheck1
-rwxr-xr-xinstall/tools/ipa-replica-manage6
-rwxr-xr-xinstall/tools/ipactl2
-rwxr-xr-xipa1
-rwxr-xr-xipa-client/ipa-install/ipa-client-install1
-rw-r--r--ipa-client/ipaclient/ipachangeconf.py2
-rw-r--r--ipa-client/ipaclient/ipadiscovery.py2
-rw-r--r--ipalib/cli.py5
-rw-r--r--ipalib/crud.py2
-rw-r--r--ipalib/errors.py2
-rw-r--r--ipalib/frontend.py4
-rw-r--r--ipalib/output.py3
-rw-r--r--ipalib/parameters.py5
-rw-r--r--ipalib/pkcs10.py4
-rw-r--r--ipalib/plugable.py3
-rw-r--r--ipalib/plugins/automount.py1
-rw-r--r--ipalib/plugins/baseldap.py2
-rw-r--r--ipalib/plugins/baseuser.py9
-rw-r--r--ipalib/plugins/batch.py1
-rw-r--r--ipalib/plugins/cert.py4
-rw-r--r--ipalib/plugins/certprofile.py4
-rw-r--r--ipalib/plugins/config.py1
-rw-r--r--ipalib/plugins/delegation.py9
-rw-r--r--ipalib/plugins/domainlevel.py1
-rw-r--r--ipalib/plugins/hbacrule.py2
-rw-r--r--ipalib/plugins/hbacsvcgroup.py2
-rw-r--r--ipalib/plugins/hbactest.py3
-rw-r--r--ipalib/plugins/host.py1
-rw-r--r--ipalib/plugins/internal.py1
-rw-r--r--ipalib/plugins/misc.py2
-rw-r--r--ipalib/plugins/otptoken.py6
-rw-r--r--ipalib/plugins/passwd.py2
-rw-r--r--ipalib/plugins/ping.py2
-rw-r--r--ipalib/plugins/pkinit.py2
-rw-r--r--ipalib/plugins/role.py2
-rw-r--r--ipalib/plugins/selfservice.py7
-rw-r--r--ipalib/plugins/server.py4
-rw-r--r--ipalib/plugins/service.py10
-rw-r--r--ipalib/plugins/stageuser.py33
-rw-r--r--ipalib/plugins/sudocmd.py6
-rw-r--r--ipalib/plugins/topology.py2
-rw-r--r--ipalib/plugins/user.py31
-rw-r--r--ipalib/plugins/vault.py6
-rw-r--r--ipalib/plugins/virtual.py1
-rw-r--r--ipalib/request.py2
-rw-r--r--ipalib/rpc.py1
-rw-r--r--ipalib/setup.py.in1
-rw-r--r--ipalib/text.py2
-rw-r--r--ipalib/util.py2
-rw-r--r--ipalib/x509.py2
-rw-r--r--ipaplatform/redhat/services.py1
-rw-r--r--ipaplatform/setup.py.in1
-rw-r--r--ipapython/certmonger.py1
-rw-r--r--ipapython/config.py2
-rw-r--r--ipapython/cookie.py1
-rw-r--r--ipapython/dnssec/bindmgr.py3
-rw-r--r--ipapython/dnssec/keysyncer.py1
-rw-r--r--ipapython/dnssec/ldapkeydb.py12
-rwxr-xr-xipapython/dnssec/localhsm.py2
-rw-r--r--ipapython/dnssec/odsmgr.py2
-rw-r--r--ipapython/dnssec/syncrepl.py7
-rw-r--r--ipapython/ipaldap.py5
-rw-r--r--ipapython/ipautil.py7
-rw-r--r--ipapython/nsslib.py3
-rwxr-xr-xipapython/setup.py.in1
-rw-r--r--ipapython/ssh.py1
-rw-r--r--ipapython/sysrestore.py1
-rw-r--r--ipaserver/dcerpc.py7
-rw-r--r--ipaserver/install/bindinstance.py1
-rw-r--r--ipaserver/install/ca.py1
-rw-r--r--ipaserver/install/cainstance.py1
-rw-r--r--ipaserver/install/certs.py1
-rw-r--r--ipaserver/install/installutils.py5
-rw-r--r--ipaserver/install/ipa_backup.py3
-rw-r--r--ipaserver/install/ipa_cacert_manage.py3
-rw-r--r--ipaserver/install/ipa_kra_install.py1
-rw-r--r--ipaserver/install/ipa_ldap_updater.py4
-rw-r--r--ipaserver/install/ipa_otptoken_import.py2
-rw-r--r--ipaserver/install/ipa_restore.py3
-rw-r--r--ipaserver/install/ipa_server_certinstall.py4
-rw-r--r--ipaserver/install/ipa_server_upgrade.py2
-rw-r--r--ipaserver/install/ipa_winsync_migrate.py2
-rw-r--r--ipaserver/install/krbinstance.py7
-rw-r--r--ipaserver/install/ldapupdate.py1
-rw-r--r--ipaserver/install/opendnssecinstance.py1
-rw-r--r--ipaserver/install/plugins/adtrust.py3
-rw-r--r--ipaserver/install/plugins/dns.py1
-rw-r--r--ipaserver/install/plugins/fix_replica_agreements.py3
-rw-r--r--ipaserver/install/server/common.py1
-rw-r--r--ipaserver/install/server/install.py2
-rw-r--r--ipaserver/install/server/replicainstall.py3
-rw-r--r--ipaserver/install/service.py1
-rw-r--r--ipaserver/install/upgradeinstance.py3
-rw-r--r--ipaserver/plugins/dogtag.py3
-rw-r--r--ipaserver/plugins/rabase.py2
-rwxr-xr-xipatests/i18n.py1
-rw-r--r--ipatests/setup.py.in1
-rw-r--r--ipatests/test_cmdline/test_cli.py1
-rw-r--r--ipatests/test_cmdline/test_help.py2
-rw-r--r--ipatests/test_cmdline/test_ipagetkeytab.py2
-rw-r--r--ipatests/test_integration/test_installation.py2
-rw-r--r--ipatests/test_ipalib/test_backend.py2
-rw-r--r--ipatests/test_ipalib/test_cli.py4
-rw-r--r--ipatests/test_ipalib/test_config.py8
-rw-r--r--ipatests/test_ipalib/test_crud.py4
-rw-r--r--ipatests/test_ipalib/test_errors.py2
-rw-r--r--ipatests/test_ipalib/test_output.py1
-rw-r--r--ipatests/test_ipalib/test_plugable.py5
-rw-r--r--ipatests/test_ipalib/test_text.py4
-rw-r--r--ipatests/test_ipapython/test_cookie.py1
-rw-r--r--ipatests/test_ipapython/test_ipautil.py2
-rw-r--r--ipatests/test_ipapython/test_keyring.py2
-rw-r--r--ipatests/test_ipapython/test_ssh.py1
-rw-r--r--ipatests/test_ipaserver/test_changepw.py2
-rw-r--r--ipatests/test_ipaserver/test_otptoken_import.py2
-rw-r--r--ipatests/test_ipaserver/test_rpcserver.py5
-rw-r--r--ipatests/test_webui/test_hostgroup.py1
-rw-r--r--ipatests/test_xmlrpc/test_automount_plugin.py2
-rw-r--r--ipatests/test_xmlrpc/test_batch_plugin.py4
-rw-r--r--ipatests/test_xmlrpc/test_caacl_plugin.py1
-rw-r--r--ipatests/test_xmlrpc/test_cert_plugin.py3
-rw-r--r--ipatests/test_xmlrpc/test_config_plugin.py3
-rw-r--r--ipatests/test_xmlrpc/test_delegation_plugin.py4
-rw-r--r--ipatests/test_xmlrpc/test_dns_plugin.py3
-rw-r--r--ipatests/test_xmlrpc/test_group_plugin.py13
-rw-r--r--ipatests/test_xmlrpc/test_hbactest_plugin.py2
-rw-r--r--ipatests/test_xmlrpc/test_netgroup_plugin.py3
-rw-r--r--ipatests/test_xmlrpc/test_old_permission_plugin.py3
-rw-r--r--ipatests/test_xmlrpc/test_passwd_plugin.py2
-rw-r--r--ipatests/test_xmlrpc/test_ping_plugin.py3
-rw-r--r--ipatests/test_xmlrpc/test_privilege_plugin.py3
-rw-r--r--ipatests/test_xmlrpc/test_role_plugin.py3
-rw-r--r--ipatests/test_xmlrpc/test_selfservice_plugin.py6
-rw-r--r--ipatests/test_xmlrpc/test_service_plugin.py3
-rw-r--r--ipatests/test_xmlrpc/test_stageuser_plugin.py13
-rw-r--r--ipatests/test_xmlrpc/test_vault_plugin.py2
-rw-r--r--ipatests/test_xmlrpc/testcert.py1
-rw-r--r--ipatests/test_xmlrpc/tracker/stageuser_plugin.py2
-rwxr-xr-xmake-lint7
-rwxr-xr-xmakeaci2
158 files changed, 152 insertions, 365 deletions
diff --git a/checks/check-ra.py b/checks/check-ra.py
index ac3b82a4a..bc9cc215b 100755
--- a/checks/check-ra.py
+++ b/checks/check-ra.py
@@ -38,7 +38,7 @@ parent = path.dirname(path.dirname(path.abspath(__file__)))
sys.path.insert(0, parent)
verbose = True
-from base64 import b64encode, b64decode
+from base64 import b64decode
from ipalib import api
subject = u'CN=vm-070.idm.lab.bos.redhat.com'
diff --git a/contrib/RHEL4/ipa-client-setup b/contrib/RHEL4/ipa-client-setup
index 1096889eb..3accd9d25 100644
--- a/contrib/RHEL4/ipa-client-setup
+++ b/contrib/RHEL4/ipa-client-setup
@@ -25,7 +25,6 @@ import sys
import os
import string
import shutil
-import socket
from ipapython.ipa_log_manager import *
from optparse import OptionParser
import ipachangeconf
diff --git a/contrib/RHEL4/ipachangeconf.py b/contrib/RHEL4/ipachangeconf.py
index de1a215b7..e0712a1a5 100644
--- a/contrib/RHEL4/ipachangeconf.py
+++ b/contrib/RHEL4/ipachangeconf.py
@@ -19,8 +19,6 @@
import fcntl
import os
-import string
-import time
import shutil
def openLocked(filename, perms):
diff --git a/contrib/RHEL4/setup.py b/contrib/RHEL4/setup.py
index f535875b4..1fa23a8bd 100644
--- a/contrib/RHEL4/setup.py
+++ b/contrib/RHEL4/setup.py
@@ -25,7 +25,6 @@ DOCLINES = __doc__.split("\n")
import os
import sys
-import distutils.sysconfig
CLASSIFIERS = """\
Development Status :: 4 - Beta
diff --git a/daemons/dnssec/ipa-dnskeysync-replica b/daemons/dnssec/ipa-dnskeysync-replica
index b6f4be5ec..69a3a68e7 100755
--- a/daemons/dnssec/ipa-dnskeysync-replica
+++ b/daemons/dnssec/ipa-dnskeysync-replica
@@ -9,19 +9,10 @@ This program should be run only on replicas, not on DNSSEC masters.
"""
from binascii import hexlify
-from datetime import datetime
-import dns.dnssec
-import fcntl
from gssapi.exceptions import GSSError
import logging
import os
-from pprint import pprint
-import subprocess
-import socket
import sys
-import systemd.daemon
-import systemd.journal
-import time
import ipalib
from ipapython.dn import DN
@@ -33,7 +24,6 @@ from ipaplatform.paths import paths
from ipapython.dnssec.abshsm import sync_pkcs11_metadata, ldap2p11helper_api_params, wrappingmech_name2id
from ipapython.dnssec.ldapkeydb import LdapKeyDB
from ipapython.dnssec.localhsm import LocalHSM
-import _ipap11helper
DAEMONNAME = 'ipa-dnskeysyncd'
PRINCIPAL = None # not initialized yet
diff --git a/daemons/dnssec/ipa-dnskeysyncd b/daemons/dnssec/ipa-dnskeysyncd
index fa54806f9..a381c29b5 100755
--- a/daemons/dnssec/ipa-dnskeysyncd
+++ b/daemons/dnssec/ipa-dnskeysyncd
@@ -6,10 +6,8 @@
import sys
import ldap
import ldapurl
-import logging
import os
import signal
-import systemd.journal
import time
from ipalib import api
diff --git a/daemons/dnssec/ipa-ods-exporter b/daemons/dnssec/ipa-ods-exporter
index b90157c4e..403ba0555 100755
--- a/daemons/dnssec/ipa-ods-exporter
+++ b/daemons/dnssec/ipa-ods-exporter
@@ -24,18 +24,15 @@ import fcntl
from gssapi.exceptions import GSSError
import logging
import os
-import subprocess
import socket
import select
import sys
import systemd.daemon
import systemd.journal
import sqlite3
-import time
import ipalib
from ipapython.dn import DN
-from ipapython.ipa_log_manager import root_logger, standard_logging_setup
from ipapython import ipaldap
from ipapython import ipautil
from ipaplatform.paths import paths
@@ -43,7 +40,6 @@ from ipaplatform.paths import paths
from ipapython.dnssec.abshsm import sync_pkcs11_metadata, wrappingmech_name2id
from ipapython.dnssec.ldapkeydb import LdapKeyDB
from ipapython.dnssec.localhsm import LocalHSM
-import _ipap11helper
DAEMONNAME = 'ipa-ods-exporter'
PRINCIPAL = None # not initialized yet
diff --git a/doc/examples/examples.py b/doc/examples/examples.py
index baf3963d6..0ecbf1e86 100644
--- a/doc/examples/examples.py
+++ b/doc/examples/examples.py
@@ -27,9 +27,8 @@ Example plugins
# First, let's import some stuff.
-# api is an object containing references to all plugins and useful classes.
# errors is a module containing all IPA specific exceptions.
-from ipalib import api, errors
+from ipalib import errors
# Command is the base class for command plugin.
from ipalib import Command
# Str is a subclass of Param, it is used to define string parameters for
diff --git a/install/migration/migration.py b/install/migration/migration.py
index 05151e66b..1d5e30704 100644
--- a/install/migration/migration.py
+++ b/install/migration/migration.py
@@ -25,11 +25,9 @@ import errno
from wsgiref.util import request_uri
from ipapython.ipa_log_manager import root_logger
-from ipapython.ipautil import get_ipa_basedn
from ipapython.dn import DN
from ipapython.ipaldap import IPAdmin
from ipalib import errors, create_api
-from ipaplatform.paths import paths
def wsgi_redirect(start_response, loc):
diff --git a/install/restart_scripts/stop_pkicad b/install/restart_scripts/stop_pkicad
index 22d492012..30b99eeff 100644
--- a/install/restart_scripts/stop_pkicad
+++ b/install/restart_scripts/stop_pkicad
@@ -19,7 +19,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import sys
import syslog
import traceback
from ipalib import api
diff --git a/install/share/copy-schema-to-ca.py b/install/share/copy-schema-to-ca.py
index ac49fcd59..10fd3d740 100755
--- a/install/share/copy-schema-to-ca.py
+++ b/install/share/copy-schema-to-ca.py
@@ -17,7 +17,7 @@ import shutil
from hashlib import sha1
-from ipapython import ipautil, dogtag
+from ipapython import ipautil
from ipapython.ipa_log_manager import root_logger, standard_logging_setup
from ipaserver.install.dsinstance import DS_USER, schema_dirname
from ipaserver.install.cainstance import PKI_USER
diff --git a/install/tools/ipa-adtrust-install b/install/tools/ipa-adtrust-install
index ff69d69e2..b1197822c 100755
--- a/install/tools/ipa-adtrust-install
+++ b/install/tools/ipa-adtrust-install
@@ -24,7 +24,6 @@
from __future__ import print_function
import six
-import gssapi
from ipaserver.install import adtrustinstance
from ipaserver.install.installutils import *
diff --git a/install/tools/ipa-compat-manage b/install/tools/ipa-compat-manage
index 4d56c61a2..1d0279b7d 100755
--- a/install/tools/ipa-compat-manage
+++ b/install/tools/ipa-compat-manage
@@ -27,7 +27,7 @@ try:
from optparse import OptionParser
from ipapython import ipautil, config
from ipaserver.install import installutils
- from ipaserver.install.ldapupdate import LDAPUpdate, BadSyntax
+ from ipaserver.install.ldapupdate import LDAPUpdate
from ipaserver.plugins.ldap2 import ldap2
from ipalib import api, errors
from ipapython.ipa_log_manager import *
diff --git a/install/tools/ipa-csreplica-manage b/install/tools/ipa-csreplica-manage
index 88ca629bb..5adfb799b 100755
--- a/install/tools/ipa-csreplica-manage
+++ b/install/tools/ipa-csreplica-manage
@@ -31,7 +31,7 @@ from ipaserver.install import (replication, installutils, bindinstance,
from ipalib import api, errors
from ipalib.constants import CACERT
from ipalib.util import has_managed_topology
-from ipapython import ipautil, ipaldap, version, dogtag
+from ipapython import ipautil, ipaldap, version
from ipapython.dn import DN
# dict of command name and tuples of min/max num of args needed
diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install
index ee7ebe0bd..720e08265 100755
--- a/install/tools/ipa-dns-install
+++ b/install/tools/ipa-dns-install
@@ -21,7 +21,7 @@
from __future__ import print_function
-from optparse import OptionGroup, SUPPRESS_HELP
+from optparse import SUPPRESS_HELP
from ipaserver.install import bindinstance, httpinstance
from ipaserver.install.installutils import *
diff --git a/install/tools/ipa-managed-entries b/install/tools/ipa-managed-entries
index 6737d6cff..9b22d2c70 100755
--- a/install/tools/ipa-managed-entries
+++ b/install/tools/ipa-managed-entries
@@ -24,7 +24,7 @@ import re
import sys
from optparse import OptionParser
-from ipapython import ipautil, config, ipaldap
+from ipapython import config, ipaldap
from ipaserver.install import installutils
from ipalib import api, errors
from ipalib.constants import CACERT
diff --git a/install/tools/ipa-nis-manage b/install/tools/ipa-nis-manage
index ac3c7907b..6136f4436 100755
--- a/install/tools/ipa-nis-manage
+++ b/install/tools/ipa-nis-manage
@@ -28,7 +28,7 @@ try:
from optparse import OptionParser
from ipapython import ipautil, config
from ipaserver.install import installutils
- from ipaserver.install.ldapupdate import LDAPUpdate, BadSyntax
+ from ipaserver.install.ldapupdate import LDAPUpdate
from ipaserver.plugins.ldap2 import ldap2
from ipalib import api, errors
from ipapython.ipa_log_manager import *
diff --git a/install/tools/ipa-otptoken-import b/install/tools/ipa-otptoken-import
index 090116dab..d6ae247c5 100755
--- a/install/tools/ipa-otptoken-import
+++ b/install/tools/ipa-otptoken-import
@@ -19,7 +19,6 @@
#
from ipaserver.install.ipa_otptoken_import import OTPTokenImport
-import nss.nss as nss
OTPTokenImport.run_cli()
diff --git a/install/tools/ipa-replica-conncheck b/install/tools/ipa-replica-conncheck
index fadc61314..d36732351 100755
--- a/install/tools/ipa-replica-conncheck
+++ b/install/tools/ipa-replica-conncheck
@@ -23,7 +23,6 @@ from __future__ import print_function
from ipapython.config import IPAOptionParser
from ipapython import version
from ipapython import ipautil, certdb
-from ipapython.ipautil import CalledProcessError
from ipalib import api, errors, x509
from ipaserver.install import installutils
import ipaclient.ipachangeconf
diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage
index 81a133192..654ea59a2 100755
--- a/install/tools/ipa-replica-manage
+++ b/install/tools/ipa-replica-manage
@@ -24,7 +24,6 @@ import sys
import os
import re
-import traceback
import ldap
import socket
import time
@@ -36,10 +35,9 @@ from ipaserver.install import replication, dsinstance, installutils
from ipaserver.install import bindinstance, cainstance, certs
from ipaserver.install import opendnssecinstance, dnskeysyncinstance
from ipapython import version, ipaldap
-from ipalib import api, errors, util
+from ipalib import api, errors
from ipalib.constants import CACERT
-from ipalib.util import (create_topology_graph,
- get_topology_connection_errors, has_managed_topology)
+from ipalib.util import has_managed_topology
from ipapython.ipa_log_manager import *
from ipapython.dn import DN
from ipapython.config import IPAOptionParser
diff --git a/install/tools/ipactl b/install/tools/ipactl
index 7be9e84ef..ff5ea5a50 100755
--- a/install/tools/ipactl
+++ b/install/tools/ipactl
@@ -32,7 +32,7 @@ from ipaserver.install.installutils import is_ipa_configured, ScriptError
from ipalib import api, errors
from ipapython.ipaldap import IPAdmin
from ipapython.ipautil import wait_for_open_ports, wait_for_open_socket
-from ipapython import config, dogtag
+from ipapython import config
from ipaplatform.tasks import tasks
from ipapython.dn import DN
from ipaplatform import services
diff --git a/ipa b/ipa
index 64ceea497..9ef356868 100755
--- a/ipa
+++ b/ipa
@@ -25,7 +25,6 @@ Command Line Interface for IPA administration.
The CLI functionality is implemented in ipalib/cli.py
"""
-import sys
from ipalib import api, cli
if __name__ == '__main__':
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index e9a7d45c3..041f5a0a0 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -31,7 +31,6 @@ try:
import getpass
from six.moves.configparser import RawConfigParser
from optparse import SUPPRESS_HELP, OptionGroup, OptionValueError
- import shutil
import dns
import gssapi
diff --git a/ipa-client/ipaclient/ipachangeconf.py b/ipa-client/ipaclient/ipachangeconf.py
index e257c8222..e73f2978c 100644
--- a/ipa-client/ipaclient/ipachangeconf.py
+++ b/ipa-client/ipaclient/ipachangeconf.py
@@ -20,8 +20,6 @@
import fcntl
import os
-import string
-import time
import shutil
import six
diff --git a/ipa-client/ipaclient/ipadiscovery.py b/ipa-client/ipaclient/ipadiscovery.py
index d21f3fbf5..2e51293c2 100644
--- a/ipa-client/ipaclient/ipadiscovery.py
+++ b/ipa-client/ipaclient/ipadiscovery.py
@@ -18,8 +18,6 @@
#
import socket
-import os
-import tempfile
from ipapython.ipa_log_manager import root_logger
from dns import resolver, rdatatype
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 567b59946..f3cd6147f 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -41,7 +41,7 @@ if six.PY3:
try:
#pylint: disable=F0401
- import default_encoding_utf8
+ import default_encoding_utf8 # pylint: disable=unused-import
except ImportError:
# This is a chicken-and-egg problem. The api can't be imported unless
# this is already installed and since it is installed with IPA therein
@@ -59,8 +59,7 @@ from ipalib.errors import (PublicError, CommandError, HelpError, InternalError,
from ipalib.constants import CLI_TAB, LDAP_GENERALIZED_TIME_FORMAT
from ipalib.parameters import File, Str, Enum, Any, Flag
from ipalib.text import _
-from ipalib import api
-from ipapython.version import API_VERSION
+from ipalib import api # pylint: disable=unused-import
from ipapython.dnsutil import DNSName
import datetime
diff --git a/ipalib/crud.py b/ipalib/crud.py
index 3a8a21791..4928c7f7d 100644
--- a/ipalib/crud.py
+++ b/ipalib/crud.py
@@ -119,7 +119,7 @@ For example, compare ``user.params`` with ``user_add.output_params`` and
Note that the above are all equal.
"""
-from ipalib.frontend import Method, Object
+from ipalib.frontend import Method
from ipalib import backend
from ipalib import parameters
from ipalib import output
diff --git a/ipalib/errors.py b/ipalib/errors.py
index b82d19949..52b770027 100644
--- a/ipalib/errors.py
+++ b/ipalib/errors.py
@@ -106,7 +106,7 @@ import six
from ipalib.text import ngettext as ungettext
from ipalib import messages
-from ipaplatform.paths import paths
+from ipaplatform.paths import paths # pylint: disable=unused-import
class PrivateError(Exception):
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index 4c7563a6b..8d5142ac2 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -23,7 +23,6 @@ Base classes for all front-end plugins.
import re
from distutils import version
-from textwrap import wrap
import six
@@ -32,7 +31,8 @@ from ipapython.ipa_log_manager import root_logger
from ipalib.capabilities import VERSION_WITHOUT_CAPABILITIES
from ipalib.base import NameSpace
from ipalib.plugable import Plugin
-from ipalib.parameters import create_param, Param, Str, Flag, Password
+from ipalib.parameters import create_param, Param, Str, Flag
+from ipalib.parameters import Password # pylint: disable=unused-import
from ipalib.output import Output, Entry, ListOfEntries
from ipalib.text import _
from ipalib.errors import (ZeroArgumentError, MaxArgumentError, OverlapError,
diff --git a/ipalib/output.py b/ipalib/output.py
index 5eb8b6b8e..92a1496e5 100644
--- a/ipalib/output.py
+++ b/ipalib/output.py
@@ -20,9 +20,6 @@
"""
Simple description of return values.
"""
-
-from inspect import getdoc
-
import six
from ipalib.plugable import ReadOnly, lock
diff --git a/ipalib/parameters.py b/ipalib/parameters.py
index dadd87d6a..e46068c96 100644
--- a/ipalib/parameters.py
+++ b/ipalib/parameters.py
@@ -104,13 +104,12 @@ import decimal
import base64
import datetime
from six.moves.xmlrpc_client import MAXINT, MININT
-import encodings.idna
-import dns.name
import six
from ipalib.text import _ as ugettext
-from ipalib.plugable import ReadOnly, lock, check_name
+from ipalib.base import check_name
+from ipalib.plugable import ReadOnly, lock
from ipalib.errors import ConversionError, RequirementError, ValidationError
from ipalib.errors import PasswordMismatch, Base64DecodeError
from ipalib.constants import TYPE_ERROR, CALLABLE_ERROR, LDAP_GENERALIZED_TIME_FORMAT
diff --git a/ipalib/pkcs10.py b/ipalib/pkcs10.py
index 7b0d8f733..e340c1a20 100644
--- a/ipalib/pkcs10.py
+++ b/ipalib/pkcs10.py
@@ -19,7 +19,6 @@
from __future__ import print_function
-import os
import sys
import base64
import nss.nss as nss
@@ -27,9 +26,6 @@ from pyasn1.type import univ, char, namedtype, tag
from pyasn1.codec.der import decoder
import six
-from ipapython import ipautil
-from ipalib import api
-
if six.PY3:
unicode = str
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index 2b593ec3b..552234327 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -25,7 +25,6 @@ you are unfamiliar with this Python feature, see
http://docs.python.org/ref/sequence-types.html
"""
-import re
import sys
import inspect
import threading
@@ -42,7 +41,7 @@ from ipalib import errors
from ipalib.config import Env
from ipalib import text
from ipalib.text import _
-from ipalib.base import ReadOnly, NameSpace, lock, islocked, check_name
+from ipalib.base import ReadOnly, NameSpace, lock, islocked
from ipalib.constants import DEFAULT_CONFIG
from ipapython.ipa_log_manager import *
from ipapython.version import VERSION, API_VERSION
diff --git a/ipalib/plugins/automount.py b/ipalib/plugins/automount.py
index a909f6c39..5e04a6b93 100644
--- a/ipalib/plugins/automount.py
+++ b/ipalib/plugins/automount.py
@@ -23,7 +23,6 @@ import os
import six
from ipalib import api, errors
-from ipalib import Object, Command
from ipalib import Flag, Str, IA5Str
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import *
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 1c822ecda..5f7b7fba1 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -35,7 +35,7 @@ from ipalib import output
from ipalib.text import _
from ipalib.util import json_serialize, validate_hostname
from ipalib.capabilities import client_has_capability
-from ipapython.dn import DN, RDN
+from ipapython.dn import DN
from ipapython.version import API_VERSION
if six.PY3:
diff --git a/ipalib/plugins/baseuser.py b/ipalib/plugins/baseuser.py
index ae7fad462..a19229ab7 100644
--- a/ipalib/plugins/baseuser.py
+++ b/ipalib/plugins/baseuser.py
@@ -17,10 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from time import gmtime, strftime
import string
-import posixpath
-import os
import six
@@ -31,14 +28,10 @@ from ipalib.plugins.baseldap import (
DN, LDAPObject, LDAPCreate, LDAPUpdate, LDAPSearch, LDAPDelete,
LDAPRetrieve, LDAPAddMember, LDAPRemoveMember)
from ipalib.plugins.service import validate_certificate
-from ipalib.plugins import baseldap
from ipalib.request import context
-from ipalib import _, ngettext
-from ipalib import output
-from ipaplatform.paths import paths
+from ipalib import _
from ipapython.ipautil import ipa_generate_password
from ipapython.ipavalidate import Email
-from ipalib.capabilities import client_has_capability
from ipalib.util import (normalize_sshpubkey, validate_sshpubkey,
convert_sshpubkey_post)
diff --git a/ipalib/plugins/batch.py b/ipalib/plugins/batch.py
index 7a4cda2a0..626ba2835 100644
--- a/ipalib/plugins/batch.py
+++ b/ipalib/plugins/batch.py
@@ -51,7 +51,6 @@ from ipalib import api, errors
from ipalib import Command
from ipalib.parameters import Str, Any
from ipalib.output import Output
-from ipalib import output
from ipalib.text import _
from ipalib.request import context
from ipalib.plugable import Registry
diff --git a/ipalib/plugins/cert.py b/ipalib/plugins/cert.py
index b4ea2feae..615f7ac25 100644
--- a/ipalib/plugins/cert.py
+++ b/ipalib/plugins/cert.py
@@ -23,7 +23,7 @@ import os
import time
import binascii
-from ipalib import Command, Str, Int, Bytes, Flag, File
+from ipalib import Command, Str, Int, Flag, File
from ipalib import api
from ipalib import errors
from ipalib import pkcs10
@@ -36,8 +36,6 @@ from ipalib.plugins.baseldap import pkey_to_value
from ipalib.plugins.service import split_any_principal
from ipalib.plugins.certprofile import validate_profile_id
import ipalib.plugins.caacl
-import base64
-import traceback
from ipalib.text import _
from ipalib.request import context
from ipalib import output
diff --git a/ipalib/plugins/certprofile.py b/ipalib/plugins/certprofile.py
index b075bf476..6329d84c3 100644
--- a/ipalib/plugins/certprofile.py
+++ b/ipalib/plugins/certprofile.py
@@ -3,12 +3,10 @@
#
import re
-from operator import attrgetter
from ipalib import api, Bool, File, Str
-from ipalib import output, util
+from ipalib import util
from ipalib.plugable import Registry
-from ipalib.plugins.virtual import VirtualCommand
from ipalib.plugins.baseldap import (
LDAPObject, LDAPSearch, LDAPCreate,
LDAPDelete, LDAPUpdate, LDAPRetrieve)
diff --git a/ipalib/plugins/config.py b/ipalib/plugins/config.py
index 86b7ca863..055a8211b 100644
--- a/ipalib/plugins/config.py
+++ b/ipalib/plugins/config.py
@@ -24,7 +24,6 @@ from ipalib.plugable import Registry
from ipalib.plugins.baseldap import *
from ipalib.plugins.selinuxusermap import validate_selinuxuser
from ipalib import _
-from ipalib.errors import ValidationError
# 389-ds attributes that should be skipped in attribute checks
OPERATIONAL_ATTRIBUTES = ('nsaccountlock', 'member', 'memberof',
diff --git a/ipalib/plugins/delegation.py b/ipalib/plugins/delegation.py
index e96114626..ca30890f7 100644
--- a/ipalib/plugins/delegation.py
+++ b/ipalib/plugins/delegation.py
@@ -18,12 +18,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from ipalib import api, _, ngettext
-from ipalib import Flag, Str
-from ipalib.request import context
-from ipalib import api, crud, errors
+from ipalib import _, ngettext
+from ipalib import Str
+from ipalib import api, crud
from ipalib import output
-from ipalib import Object, Command
+from ipalib import Object
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import gen_pkey_only_option, pkey_to_value
diff --git a/ipalib/plugins/domainlevel.py b/ipalib/plugins/domainlevel.py
index 838a518e7..23fa2a1b2 100644
--- a/ipalib/plugins/domainlevel.py
+++ b/ipalib/plugins/domainlevel.py
@@ -10,7 +10,6 @@ from ipalib import errors
from ipalib import output
from ipalib.parameters import Int
from ipalib.plugable import Registry
-from ipalib.plugins.baseldap import LDAPObject, LDAPUpdate, LDAPRetrieve
from ipapython.dn import DN
diff --git a/ipalib/plugins/hbacrule.py b/ipalib/plugins/hbacrule.py
index 82a52bd80..aa0e79c17 100644
--- a/ipalib/plugins/hbacrule.py
+++ b/ipalib/plugins/hbacrule.py
@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from ipalib import api, errors
-from ipalib import AccessTime, Password, Str, StrEnum, Bool, DeprecatedParam
+from ipalib import AccessTime, Str, StrEnum, Bool, DeprecatedParam
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import *
from ipalib import _, ngettext
diff --git a/ipalib/plugins/hbacsvcgroup.py b/ipalib/plugins/hbacsvcgroup.py
index 2bc92cb24..71df7fdbc 100644
--- a/ipalib/plugins/hbacsvcgroup.py
+++ b/ipalib/plugins/hbacsvcgroup.py
@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from ipalib import api, errors
+from ipalib import api
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import *
from ipalib import _, ngettext
diff --git a/ipalib/plugins/hbactest.py b/ipalib/plugins/hbactest.py
index 5999b6bf5..fb0c03389 100644
--- a/ipalib/plugins/hbactest.py
+++ b/ipalib/plugins/hbactest.py
@@ -19,8 +19,7 @@
from ipalib import api, errors, output, util
from ipalib import Command, Str, Flag, Int, DeprecatedParam
-from ipalib.cli import to_cli
-from ipalib import _, ngettext
+from ipalib import _
from ipapython.dn import DN
from ipalib.plugable import Registry
if api.env.in_server and api.env.context in ['lite', 'server']:
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index 842dff042..d9be712d6 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -18,7 +18,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from nss.error import NSPRError
import string
import six
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index 1c58b6bd1..276e92da8 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -26,7 +26,6 @@ from __future__ import print_function
import json
-from ipalib import api
from ipalib import Command
from ipalib import Str
from ipalib.output import Output
diff --git a/ipalib/plugins/misc.py b/ipalib/plugins/misc.py
index 67bb92952..4284f0c6c 100644
--- a/ipalib/plugins/misc.py
+++ b/ipalib/plugins/misc.py
@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import re
-from ipalib import api, LocalOrRemote, _, ngettext
+from ipalib import LocalOrRemote, _, ngettext
from ipalib.output import Output, summary
from ipalib import Flag
from ipalib.plugable import Registry
diff --git a/ipalib/plugins/otptoken.py b/ipalib/plugins/otptoken.py
index 846155dfb..2d7e99d06 100644
--- a/ipalib/plugins/otptoken.py
+++ b/ipalib/plugins/otptoken.py
@@ -23,7 +23,11 @@ from ipalib.plugins.baseldap import DN, LDAPObject, LDAPAddMember, LDAPRemoveMem
from ipalib.plugins.baseldap import LDAPCreate, LDAPDelete, LDAPUpdate, LDAPSearch, LDAPRetrieve
from ipalib import api, Int, Str, Bool, DateTime, Flag, Bytes, IntEnum, StrEnum, Password, _, ngettext
from ipalib.plugable import Registry
-from ipalib.errors import PasswordMismatch, ConversionError, LastMemberError, NotFound, ValidationError
+from ipalib.errors import (
+ PasswordMismatch,
+ ConversionError,
+ NotFound,
+ ValidationError)
from ipalib.request import context
from ipalib.frontend import Local
from ipaplatform.paths import paths
diff --git a/ipalib/plugins/passwd.py b/ipalib/plugins/passwd.py
index a4f791c1b..2f303472c 100644
--- a/ipalib/plugins/passwd.py
+++ b/ipalib/plugins/passwd.py
@@ -23,7 +23,7 @@ from ipalib import Str, Password
from ipalib import _
from ipalib import output
from ipalib.plugable import Registry
-from ipalib.plugins.user import split_principal, validate_principal, normalize_principal
+from ipalib.plugins.baseuser import validate_principal, normalize_principal
from ipalib.request import context
from ipapython.dn import DN
diff --git a/ipalib/plugins/ping.py b/ipalib/plugins/ping.py
index 52da5d4bc..6a514125c 100644
--- a/ipalib/plugins/ping.py
+++ b/ipalib/plugins/ping.py
@@ -19,7 +19,7 @@
from ipalib import Command
from ipalib import output
-from ipalib import _, ngettext
+from ipalib import _
from ipalib.plugable import Registry
from ipapython.version import VERSION, API_VERSION
diff --git a/ipalib/plugins/pkinit.py b/ipalib/plugins/pkinit.py
index 5f00b2b46..9aa101063 100644
--- a/ipalib/plugins/pkinit.py
+++ b/ipalib/plugins/pkinit.py
@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from ipalib import api, errors
-from ipalib import Int, Str
+from ipalib import Str
from ipalib import Object, Command
from ipalib import _
from ipalib.plugable import Registry
diff --git a/ipalib/plugins/role.py b/ipalib/plugins/role.py
index 6d8d544aa..82e2a5571 100644
--- a/ipalib/plugins/role.py
+++ b/ipalib/plugins/role.py
@@ -21,8 +21,6 @@
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import *
from ipalib import api, Str, _, ngettext
-from ipalib import Command
-from ipalib.plugins import privilege
__doc__ = _("""
Roles
diff --git a/ipalib/plugins/selfservice.py b/ipalib/plugins/selfservice.py
index 9cf6900d1..f733768bc 100644
--- a/ipalib/plugins/selfservice.py
+++ b/ipalib/plugins/selfservice.py
@@ -17,12 +17,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from ipalib import api, _, ngettext
-from ipalib import Flag, Str
-from ipalib.request import context
+from ipalib import _, ngettext
+from ipalib import Str
from ipalib import api, crud, errors
from ipalib import output
-from ipalib import Object, Command
+from ipalib import Object
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import gen_pkey_only_option, pkey_to_value
diff --git a/ipalib/plugins/server.py b/ipalib/plugins/server.py
index 6286c5959..4f1959a25 100644
--- a/ipalib/plugins/server.py
+++ b/ipalib/plugins/server.py
@@ -2,9 +2,6 @@
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
#
-import string
-import os
-
import dbus
import dbus.mainloop.glib
@@ -12,7 +9,6 @@ from ipalib import api, crud, errors, messages
from ipalib import Int, Str
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import *
-from ipalib.plugins import baseldap
from ipalib.request import context
from ipalib import _, ngettext
diff --git a/ipalib/plugins/service.py b/ipalib/plugins/service.py
index 4752e198b..4ef4d4362 100644
--- a/ipalib/plugins/service.py
+++ b/ipalib/plugins/service.py
@@ -19,21 +19,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import base64
-import os
-
import six
-from ipalib import api, errors, util
-from ipalib import Str, Flag, Bytes, StrEnum, Bool
+from ipalib import api, errors
+from ipalib import Bytes, StrEnum, Bool
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import *
from ipalib import x509
from ipalib import _, ngettext
from ipalib import util
import nss.nss as nss
-from nss.error import NSPRError
-from ipapython.ipautil import file_exists
+
if six.PY3:
unicode = str
diff --git a/ipalib/plugins/stageuser.py b/ipalib/plugins/stageuser.py
index 995f67923..bbbaf55a5 100644
--- a/ipalib/plugins/stageuser.py
+++ b/ipalib/plugins/stageuser.py
@@ -17,35 +17,40 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from time import gmtime, strftime
-import string
import posixpath
-import os
from copy import deepcopy
import six
from ipalib import api, errors
-from ipalib import (Flag, Int, Password, Str, Bool, StrEnum, DateTime,
- DeprecatedParam)
+from ipalib import DeprecatedParam
from ipalib.plugable import Registry
-from ipalib.plugins.baseldap import LDAPCreate, LDAPQuery, LDAPSearch, DN, entry_to_dict, pkey_to_value
+from ipalib.plugins.baseldap import (
+ LDAPCreate,
+ LDAPQuery,
+ DN,
+ entry_to_dict,
+ pkey_to_value)
from ipalib.plugins import baseldap
from ipalib.plugins.baseuser import (
- baseuser, baseuser_add, baseuser_del, baseuser_mod, baseuser_find,
- baseuser_show, NO_UPG_MAGIC, radius_dn2pk, baseuser_pwdchars,
- fix_addressbook_permission_bindrule, normalize_principal,
- validate_principal, baseuser_output_params, status_baseuser_output_params,
- baseuser_add_manager, baseuser_remove_manager)
+ baseuser,
+ baseuser_add,
+ baseuser_del,
+ baseuser_mod,
+ baseuser_find,
+ baseuser_show,
+ NO_UPG_MAGIC,
+ baseuser_pwdchars,
+ baseuser_output_params,
+ status_baseuser_output_params,
+ baseuser_add_manager,
+ baseuser_remove_manager)
from ipalib.request import context
from ipalib import _, ngettext
from ipalib import output
from ipaplatform.paths import paths
from ipapython.ipautil import ipa_generate_password
-from ipapython.ipavalidate import Email
from ipalib.capabilities import client_has_capability
-from ipalib.util import (normalize_sshpubkey, validate_sshpubkey,
- convert_sshpubkey_post)
if six.PY3:
unicode = str
diff --git a/ipalib/plugins/sudocmd.py b/ipalib/plugins/sudocmd.py
index 4654ecc88..37776adc0 100644
--- a/ipalib/plugins/sudocmd.py
+++ b/ipalib/plugins/sudocmd.py
@@ -17,11 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import platform
-import os
-import sys
-
-from ipalib import api, errors, util
+from ipalib import api, errors
from ipalib import Str
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import *
diff --git a/ipalib/plugins/topology.py b/ipalib/plugins/topology.py
index 128a34748..f397300ad 100644
--- a/ipalib/plugins/topology.py
+++ b/ipalib/plugins/topology.py
@@ -5,7 +5,7 @@
import six
from ipalib import api, errors
-from ipalib import Int, Str, Bool, StrEnum, Flag, DNParam
+from ipalib import Int, Str, StrEnum, Flag, DNParam
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import (
LDAPObject, LDAPSearch, LDAPCreate, LDAPDelete, LDAPUpdate, LDAPQuery,
diff --git a/ipalib/plugins/user.py b/ipalib/plugins/user.py
index 2b792af62..0017c09d7 100644
--- a/ipalib/plugins/user.py
+++ b/ipalib/plugins/user.py
@@ -19,21 +19,30 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from time import gmtime, strftime
-import string
import posixpath
import os
import six
-from ipalib import api, errors, util
-from ipalib import Flag, Int, Password, Str, Bool, StrEnum, DateTime
+from ipalib import util
+from ipalib import Bool
from ipalib.plugins.baseuser import (
- baseuser, baseuser_add, baseuser_del, baseuser_mod, baseuser_find,
- baseuser_show, NO_UPG_MAGIC, UPG_DEFINITION_DN, baseuser_output_params,
- status_baseuser_output_params, baseuser_pwdchars, validate_nsaccountlock,
- radius_dn2pk, convert_nsaccountlock, split_principal, validate_principal,
- normalize_principal, fix_addressbook_permission_bindrule,
- baseuser_add_manager, baseuser_remove_manager)
+ baseuser,
+ baseuser_add,
+ baseuser_del,
+ baseuser_mod,
+ baseuser_find,
+ baseuser_show,
+ NO_UPG_MAGIC,
+ UPG_DEFINITION_DN,
+ baseuser_output_params,
+ status_baseuser_output_params,
+ baseuser_pwdchars,
+ validate_nsaccountlock,
+ convert_nsaccountlock,
+ fix_addressbook_permission_bindrule,
+ baseuser_add_manager,
+ baseuser_remove_manager)
from ipalib.plugins.idviews import remove_ipaobject_overrides
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import *
@@ -44,10 +53,8 @@ from ipalib import output
from ipalib import x509
from ipaplatform.paths import paths
from ipapython.ipautil import ipa_generate_password
-from ipapython.ipavalidate import Email
from ipalib.capabilities import client_has_capability
-from ipalib.util import (normalize_sshpubkey, validate_sshpubkey,
- convert_sshpubkey_post)
+
if api.env.in_server:
from ipaserver.plugins.ldap2 import ldap2
diff --git a/ipalib/plugins/vault.py b/ipalib/plugins/vault.py
index f94bf9d65..0cf6f1d24 100644
--- a/ipalib/plugins/vault.py
+++ b/ipalib/plugins/vault.py
@@ -25,7 +25,6 @@ import io
import json
import os
import sys
-import tempfile
from cryptography.fernet import Fernet, InvalidToken
from cryptography.hazmat.backends import default_backend
@@ -41,18 +40,17 @@ from ipalib.frontend import Command, Object, Local
from ipalib import api, errors
from ipalib import Bytes, Flag, Str, StrEnum
from ipalib import output
-from ipalib.crud import PKQuery, Retrieve, Update
+from ipalib.crud import PKQuery, Retrieve
from ipalib.plugable import Registry
from ipalib.plugins.baseldap import LDAPObject, LDAPCreate, LDAPDelete,\
LDAPSearch, LDAPUpdate, LDAPRetrieve, LDAPAddMember, LDAPRemoveMember,\
LDAPModMember, pkey_to_value
from ipalib.request import context
-from ipalib.plugins.user import split_principal
+from ipalib.plugins.baseuser import split_principal
from ipalib.plugins.service import normalize_principal
from ipalib import _, ngettext
from ipaplatform.paths import paths
from ipapython.dn import DN
-from ipapython.nsslib import current_dbdir
if api.env.in_server:
import pki.account
diff --git a/ipalib/plugins/virtual.py b/ipalib/plugins/virtual.py
index 3bbe32e53..2ba69f651 100644
--- a/ipalib/plugins/virtual.py
+++ b/ipalib/plugins/virtual.py
@@ -20,7 +20,6 @@
"""
Base classes for non-LDAP backend plugins.
"""
-from ipalib import api
from ipalib import Command
from ipalib import errors
from ipapython.dn import DN
diff --git a/ipalib/request.py b/ipalib/request.py
index 5a6baba42..9484be58f 100644
--- a/ipalib/request.py
+++ b/ipalib/request.py
@@ -25,7 +25,7 @@ Per-request thread-local data.
import threading
from ipalib.base import ReadOnly, lock
-from ipalib.constants import OVERRIDE_ERROR, CALLABLE_ERROR
+from ipalib.constants import CALLABLE_ERROR
# Thread-local storage of most per-request information
diff --git a/ipalib/rpc.py b/ipalib/rpc.py
index 3664b265a..a165491ad 100644
--- a/ipalib/rpc.py
+++ b/ipalib/rpc.py
@@ -31,7 +31,6 @@ Also see the `ipaserver.rpcserver` module.
"""
from decimal import Decimal
-import sys
import datetime
import os
import locale
diff --git a/ipalib/setup.py.in b/ipalib/setup.py.in
index 47481dbe0..8107c81ff 100644
--- a/ipalib/setup.py.in
+++ b/ipalib/setup.py.in
@@ -25,7 +25,6 @@ DOCLINES = __doc__.split("\n")
import os
import sys
-import distutils.sysconfig
CLASSIFIERS = """\
Intended Audience :: System Environment/Base
diff --git a/ipalib/text.py b/ipalib/text.py
index 28953fa78..34e5f1a89 100644
--- a/ipalib/text.py
+++ b/ipalib/text.py
@@ -112,8 +112,6 @@ For additional details, see `GettextFactory` and `Gettext`, and for plural
forms, see `NGettextFactory` and `NGettext`.
"""
-import threading
-import locale
import gettext
import six
diff --git a/ipalib/util.py b/ipalib/util.py
index c9a0237fb..6c70fbdfc 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -22,8 +22,6 @@ Various utility functions.
"""
import os
-import imp
-import time
import socket
import re
import decimal
diff --git a/ipalib/x509.py b/ipalib/x509.py
index 037d6785c..237c002c2 100644
--- a/ipalib/x509.py
+++ b/ipalib/x509.py
@@ -44,8 +44,6 @@ from pyasn1.type import univ, namedtype, tag
from pyasn1.codec.der import decoder, encoder
import six
-from ipapython import ipautil
-from ipalib import api
from ipalib import _
from ipalib import util
from ipalib import errors
diff --git a/ipaplatform/redhat/services.py b/ipaplatform/redhat/services.py
index 6fad2288b..11292fa49 100644
--- a/ipaplatform/redhat/services.py
+++ b/ipaplatform/redhat/services.py
@@ -24,7 +24,6 @@ Contains Red Hat OS family-specific service class implementations.
import os
import time
-import xml.dom.minidom
import contextlib
from ipaplatform.tasks import tasks
diff --git a/ipaplatform/setup.py.in b/ipaplatform/setup.py.in
index 08f6c30dd..11bb7573f 100644
--- a/ipaplatform/setup.py.in
+++ b/ipaplatform/setup.py.in
@@ -25,7 +25,6 @@ DOCLINES = __doc__.split("\n")
import os
import sys
-import distutils.sysconfig
CLASSIFIERS = """\
Development Status :: 4 - Beta
diff --git a/ipapython/certmonger.py b/ipapython/certmonger.py
index 2a4e43d3c..17c20f9f0 100644
--- a/ipapython/certmonger.py
+++ b/ipapython/certmonger.py
@@ -31,7 +31,6 @@ import dbus
import shlex
import subprocess
import tempfile
-from ipapython import ipautil
from ipapython.ipa_log_manager import *
from ipaplatform.paths import paths
from ipaplatform import services
diff --git a/ipapython/config.py b/ipapython/config.py
index cd61db0b2..cbf479a17 100644
--- a/ipapython/config.py
+++ b/ipapython/config.py
@@ -30,7 +30,7 @@ import dns.name
from six.moves.urllib.parse import urlsplit
import socket
-import re
+
class IPAConfigError(Exception):
def __init__(self, msg=''):
diff --git a/ipapython/cookie.py b/ipapython/cookie.py
index d51b005a2..b44522157 100644
--- a/ipapython/cookie.py
+++ b/ipapython/cookie.py
@@ -18,7 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import re
-import time
import datetime
import email.utils
from calendar import timegm
diff --git a/ipapython/dnssec/bindmgr.py b/ipapython/dnssec/bindmgr.py
index a0a9f2eb2..6bf509d4f 100644
--- a/ipapython/dnssec/bindmgr.py
+++ b/ipapython/dnssec/bindmgr.py
@@ -6,12 +6,9 @@ from datetime import datetime
import dns.name
import errno
import os
-import logging
import shutil
import stat
-import subprocess
-from ipalib import api
import ipalib.constants
from ipapython.dn import DN
from ipapython import ipa_log_manager, ipautil
diff --git a/ipapython/dnssec/keysyncer.py b/ipapython/dnssec/keysyncer.py
index 426dd940a..aa96dba20 100644
--- a/ipapython/dnssec/keysyncer.py
+++ b/ipapython/dnssec/keysyncer.py
@@ -2,7 +2,6 @@
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
-import logging
import ldap.dn
import os
diff --git a/ipapython/dnssec/ldapkeydb.py b/ipapython/dnssec/ldapkeydb.py
index 806999375..384bffee1 100644
--- a/ipapython/dnssec/ldapkeydb.py
+++ b/ipapython/dnssec/ldapkeydb.py
@@ -4,17 +4,15 @@
from binascii import hexlify
import collections
-import sys
-import time
import ipalib
from ipapython.dn import DN
-from ipapython import ipaldap
-from ipapython import ipautil
-from ipaplatform.paths import paths
-from ipapython.dnssec.abshsm import (attrs_name2id, attrs_id2name, AbstractHSM,
- bool_attr_names, populate_pkcs11_metadata)
+from ipapython.dnssec.abshsm import (
+ attrs_name2id,
+ AbstractHSM,
+ bool_attr_names,
+ populate_pkcs11_metadata)
import _ipap11helper
import uuid
diff --git a/ipapython/dnssec/localhsm.py b/ipapython/dnssec/localhsm.py
index 2eab5c351..76ab00444 100755
--- a/ipapython/dnssec/localhsm.py
+++ b/ipapython/dnssec/localhsm.py
@@ -10,8 +10,6 @@ import collections
import logging
import os
from pprint import pprint
-import sys
-import time
from ipaplatform.paths import paths
diff --git a/ipapython/dnssec/odsmgr.py b/ipapython/dnssec/odsmgr.py
index ebcd3aa24..041ad1fc9 100644
--- a/ipapython/dnssec/odsmgr.py
+++ b/ipapython/dnssec/odsmgr.py
@@ -3,10 +3,8 @@
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
-import logging
from lxml import etree
import dns.name
-import subprocess
from ipapython import ipa_log_manager, ipautil
diff --git a/ipapython/dnssec/syncrepl.py b/ipapython/dnssec/syncrepl.py
index 595582cb8..e6bda0850 100644
--- a/ipapython/dnssec/syncrepl.py
+++ b/ipapython/dnssec/syncrepl.py
@@ -9,18 +9,11 @@ to a local dict.
# Import the python-ldap modules
import ldap
-import ldapurl
# Import specific classes from python-ldap
from ldap.cidict import cidict
from ldap.ldapobject import ReconnectLDAPObject
from ldap.syncrepl import SyncreplConsumer
-# Import modules from Python standard lib
-import signal
-import time
-import sys
-import logging
-
from ipapython import ipa_log_manager
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
index bbd27ac88..28bfcb5c2 100644
--- a/ipapython/ipaldap.py
+++ b/ipapython/ipaldap.py
@@ -19,7 +19,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-import string
import time
import datetime
import shutil
@@ -33,18 +32,16 @@ import pwd
import ldap
import ldap.sasl
import ldap.filter
-from ldap.ldapobject import SimpleLDAPObject
from ldap.controls import SimplePagedResultsControl
import ldapurl
import six
from ipalib import errors, _
from ipalib.constants import LDAP_GENERALIZED_TIME_FORMAT
-from ipapython import ipautil
from ipapython.ipautil import (
format_netloc, wait_for_open_socket, wait_for_open_ports, CIDict)
from ipapython.ipa_log_manager import log_mgr
-from ipapython.dn import DN, RDN
+from ipapython.dn import DN
from ipapython.dnsutil import DNSName
if six.PY3:
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index bd1cf78fa..a0e34e298 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -23,12 +23,11 @@ import string
import tempfile
import subprocess
import random
-import os, sys, traceback
+import os, sys
import copy
import stat
import shutil
import socket
-import struct
import re
import datetime
import netaddr
@@ -40,14 +39,14 @@ from contextlib import contextmanager
import locale
import collections
-from dns import resolver, rdatatype, reversename
+from dns import resolver, reversename
from dns.exception import DNSException
+
import six
from six.moves import input
from six.moves import urllib
from ipapython.ipa_log_manager import *
-from ipapython import ipavalidate
from ipapython import config
from ipaplatform.paths import paths
from ipapython.dn import DN
diff --git a/ipapython/nsslib.py b/ipapython/nsslib.py
index 06e53294f..3c776ae0e 100644
--- a/ipapython/nsslib.py
+++ b/ipapython/nsslib.py
@@ -20,7 +20,6 @@
from __future__ import print_function
-import sys
import getpass
import socket
from ipapython.ipa_log_manager import *
@@ -38,8 +37,6 @@ try:
except ImportError:
import http.client as httplib
-from ipaplatform.paths import paths
-
# NSS database currently open
current_dbdir = None
diff --git a/ipapython/setup.py.in b/ipapython/setup.py.in
index bdefe7c9a..af814cbe6 100755
--- a/ipapython/setup.py.in
+++ b/ipapython/setup.py.in
@@ -25,7 +25,6 @@ DOCLINES = __doc__.split("\n")
import os
import sys
-import distutils.sysconfig
CLASSIFIERS = """\
Development Status :: 4 - Beta
diff --git a/ipapython/ssh.py b/ipapython/ssh.py
index daa44bdd9..c76cf51e4 100644
--- a/ipapython/ssh.py
+++ b/ipapython/ssh.py
@@ -25,7 +25,6 @@ SSH utilities.
import base64
import re
import struct
-import binascii
from hashlib import md5, sha1
from hashlib import sha256 #pylint: disable=E0611
diff --git a/ipapython/sysrestore.py b/ipapython/sysrestore.py
index 830060c5a..93f39fa85 100644
--- a/ipapython/sysrestore.py
+++ b/ipapython/sysrestore.py
@@ -33,7 +33,6 @@ import string
import six
from six.moves.configparser import SafeConfigParser
-from ipapython import ipautil
from ipaplatform.tasks import tasks
from ipaplatform.paths import paths
diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py
index bb58945ef..1f84e6e8e 100644
--- a/ipaserver/dcerpc.py
+++ b/ipaserver/dcerpc.py
@@ -23,9 +23,7 @@
# package is installed to avoid issues with unavailable modules
from ipalib.plugins.baseldap import *
-from ipalib import api, Str, Password, DefaultFrom, _, ngettext, Object
-from ipalib.parameters import Enum
-from ipalib import Command
+from ipalib import api, _
from ipalib import errors
from ipapython import ipautil
from ipapython.ipa_log_manager import *
@@ -33,8 +31,7 @@ from ipapython.dn import DN
from ipaserver.install import installutils
from ipalib.util import normalize_name
-import os, string, struct, copy
-import uuid
+import os, struct
from samba import param
from samba import credentials
from samba.dcerpc import security, lsa, drsblobs, nbt, netlogon
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index 8daca552d..d679bbc89 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -41,7 +41,6 @@ from ipalib import api, errors
from ipaplatform import services
from ipaplatform.constants import constants
from ipaplatform.paths import paths
-from ipaplatform.tasks import tasks
from ipalib.util import (validate_zonemgr_str, normalize_zonemgr,
get_dns_forward_zone_update_policy,
get_dns_reverse_zone_update_policy,
diff --git a/ipaserver/install/ca.py b/ipaserver/install/ca.py
index 36a7d57b9..8420a8ddf 100644
--- a/ipaserver/install/ca.py
+++ b/ipaserver/install/ca.py
@@ -5,7 +5,6 @@
from __future__ import print_function
import sys
-import os.path
from ipaserver.install import cainstance, dsinstance, bindinstance
from ipapython import ipautil, certdb
diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
index 736af7c38..f3c1bfa36 100644
--- a/ipaserver/install/cainstance.py
+++ b/ipaserver/install/cainstance.py
@@ -31,7 +31,6 @@ import pwd
import re
import shutil
import stat
-import subprocess
import sys
import syslog
import time
diff --git a/ipaserver/install/certs.py b/ipaserver/install/certs.py
index b5b551a60..1591362b4 100644
--- a/ipaserver/install/certs.py
+++ b/ipaserver/install/certs.py
@@ -42,7 +42,6 @@ from ipapython.dn import DN
from ipalib import pkcs10, x509, api
from ipalib.errors import CertificateOperationError
from ipalib.text import _
-from ipaplatform import services
from ipaplatform.constants import constants
from ipaplatform.paths import paths
diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py
index bdbe2e38b..6c00c3482 100644
--- a/ipaserver/install/installutils.py
+++ b/ipaserver/install/installutils.py
@@ -39,7 +39,6 @@ from dns import resolver, rdatatype
from dns.exception import DNSException
import ldap
import ldapurl
-from nss.error import NSPRError
import six
from six.moves.configparser import SafeConfigParser, NoOptionError
@@ -47,7 +46,7 @@ import ipaplatform
from ipapython import ipautil, sysrestore, admintool, version
from ipapython.admintool import ScriptError
-from ipapython.ipa_log_manager import root_logger, log_mgr
+from ipapython.ipa_log_manager import root_logger
from ipalib.util import validate_hostname
from ipapython import config
from ipalib import api, errors, x509
@@ -56,8 +55,6 @@ from ipaserver.install import certs, service, sysupgrade
from ipaplatform import services
from ipaplatform.paths import paths
from ipaplatform.tasks import tasks
-from ipapython import certmonger
-
if six.PY3:
unicode = str
diff --git a/ipaserver/install/ipa_backup.py b/ipaserver/install/ipa_backup.py
index 8e9b258bf..d49576d7d 100644
--- a/ipaserver/install/ipa_backup.py
+++ b/ipaserver/install/ipa_backup.py
@@ -18,12 +18,10 @@
#
import os
-import sys
import shutil
import tempfile
import time
import pwd
-from optparse import OptionGroup
from ipaplatform.paths import paths
from ipaplatform import services
@@ -33,7 +31,6 @@ from ipalib import api, errors
from ipapython import version
from ipapython.ipautil import run, write_tmp_file
from ipapython import admintool
-from ipapython.config import IPAOptionParser
from ipapython.dn import DN
from ipaserver.install.dsinstance import DS_USER
from ipaserver.install.replication import wait_for_task
diff --git a/ipaserver/install/ipa_cacert_manage.py b/ipaserver/install/ipa_cacert_manage.py
index 110feb2cc..2a4e8efc1 100644
--- a/ipaserver/install/ipa_cacert_manage.py
+++ b/ipaserver/install/ipa_cacert_manage.py
@@ -20,9 +20,7 @@
from __future__ import print_function
import os
-import time
from optparse import OptionGroup
-import base64
from nss import nss
from nss.error import NSPRError
import gssapi
@@ -32,7 +30,6 @@ from ipapython.dn import DN
from ipaplatform.paths import paths
from ipalib import api, errors, x509, certstore
from ipaserver.install import certs, cainstance, installutils
-from ipaserver.plugins.ldap2 import ldap2
class CACertManage(admintool.AdminTool):
diff --git a/ipaserver/install/ipa_kra_install.py b/ipaserver/install/ipa_kra_install.py
index 643ad4031..33c1072db 100644
--- a/ipaserver/install/ipa_kra_install.py
+++ b/ipaserver/install/ipa_kra_install.py
@@ -25,7 +25,6 @@ import tempfile
from textwrap import dedent
from ipalib import api
from ipalib.constants import DOMAIN_LEVEL_0
-from ipaplatform import services
from ipaplatform.paths import paths
from ipapython import admintool
from ipapython import ipautil
diff --git a/ipaserver/install/ipa_ldap_updater.py b/ipaserver/install/ipa_ldap_updater.py
index 90c09c48f..2f91a830f 100644
--- a/ipaserver/install/ipa_ldap_updater.py
+++ b/ipaserver/install/ipa_ldap_updater.py
@@ -31,9 +31,9 @@ import sys
import six
from ipalib import api
-from ipapython import ipautil, admintool
+from ipapython import admintool
from ipaplatform.paths import paths
-from ipaserver.install import installutils, dsinstance, schemaupdate
+from ipaserver.install import installutils, schemaupdate
from ipaserver.install.ldapupdate import LDAPUpdate, UPDATES_DIR, BadSyntax
from ipaserver.install.upgradeinstance import IPAUpgrade
diff --git a/ipaserver/install/ipa_otptoken_import.py b/ipaserver/install/ipa_otptoken_import.py
index 10b8af6f1..8ea67fce1 100644
--- a/ipaserver/install/ipa_otptoken_import.py
+++ b/ipaserver/install/ipa_otptoken_import.py
@@ -36,7 +36,7 @@ from six.moves import xrange
from ipapython import admintool
from ipalib import api, errors
-from ipaserver.plugins.ldap2 import ldap2, AUTOBIND_DISABLED
+from ipaserver.plugins.ldap2 import AUTOBIND_DISABLED
if six.PY3:
unicode = str
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
index dd8de209a..b223bd287 100644
--- a/ipaserver/install/ipa_restore.py
+++ b/ipaserver/install/ipa_restore.py
@@ -18,17 +18,14 @@
#
import os
-import sys
import shutil
import tempfile
import time
import pwd
import ldif
import itertools
-import locale
from six.moves.configparser import SafeConfigParser
-import six
from ipalib import api, errors, constants
from ipapython import version, ipautil, certdb
diff --git a/ipaserver/install/ipa_server_certinstall.py b/ipaserver/install/ipa_server_certinstall.py
index ac0b0274e..a7af319c6 100644
--- a/ipaserver/install/ipa_server_certinstall.py
+++ b/ipaserver/install/ipa_server_certinstall.py
@@ -18,7 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-import sys
import os
import os.path
import pwd
@@ -28,10 +27,9 @@ from ipaplatform.constants import constants
from ipaplatform.paths import paths
from ipapython import admintool
from ipapython.dn import DN
-from ipapython.ipautil import user_input, write_tmp_file
from ipalib import api, errors
from ipalib.constants import CACERT
-from ipaserver.install import certs, dsinstance, httpinstance, installutils
+from ipaserver.install import certs, dsinstance, installutils
class ServerCertInstall(admintool.AdminTool):
diff --git a/ipaserver/install/ipa_server_upgrade.py b/ipaserver/install/ipa_server_upgrade.py
index 2ebdf9185..c38470474 100644
--- a/ipaserver/install/ipa_server_upgrade.py
+++ b/ipaserver/install/ipa_server_upgrade.py
@@ -2,8 +2,6 @@
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
#
-import os
-
from ipalib import api
from ipaplatform.paths import paths
from ipapython import admintool
diff --git a/ipaserver/install/ipa_winsync_migrate.py b/ipaserver/install/ipa_winsync_migrate.py
index bbd029c81..bf4f7be6b 100644
--- a/ipaserver/install/ipa_winsync_migrate.py
+++ b/ipaserver/install/ipa_winsync_migrate.py
@@ -27,8 +27,6 @@ from ipalib import errors
from ipapython import admintool
from ipapython.dn import DN
from ipapython.ipautil import realm_to_suffix, posixify
-from ipapython.ipa_log_manager import log_mgr
-from ipaserver.plugins.ldap2 import ldap2
from ipaserver.install import replication, installutils
if six.PY3:
diff --git a/ipaserver/install/krbinstance.py b/ipaserver/install/krbinstance.py
index 20de71de0..1118ddafb 100644
--- a/ipaserver/install/krbinstance.py
+++ b/ipaserver/install/krbinstance.py
@@ -21,9 +21,6 @@ from __future__ import absolute_import
from __future__ import print_function
import shutil
-import fileinput
-import re
-import sys
import os
import pwd
import socket
@@ -34,7 +31,6 @@ from ipaserver.install import installutils
from ipapython import sysrestore
from ipapython import ipautil
from ipapython import kernel_keyring
-from ipalib import errors
from ipalib.constants import CACERT
from ipapython.ipa_log_manager import *
from ipapython.dn import DN
@@ -43,9 +39,6 @@ from ipaserver.install import replication
from ipaserver.install import dsinstance
from ipaserver.install import ldapupdate
-import pyasn1.codec.ber.decoder
-import struct
-
from ipaserver.install import certs
from distutils import version
from ipaplatform.tasks import tasks
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py
index 2ed5e8f4e..528e52bbd 100644
--- a/ipaserver/install/ldapupdate.py
+++ b/ipaserver/install/ldapupdate.py
@@ -30,7 +30,6 @@ import time
import os
import pwd
import fnmatch
-import re
import ldap
diff --git a/ipaserver/install/opendnssecinstance.py b/ipaserver/install/opendnssecinstance.py
index 533d53afa..357908fb4 100644
--- a/ipaserver/install/opendnssecinstance.py
+++ b/ipaserver/install/opendnssecinstance.py
@@ -2,7 +2,6 @@
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
-import random
import os
import pwd
import grp
diff --git a/ipaserver/install/plugins/adtrust.py b/ipaserver/install/plugins/adtrust.py
index 5510dfd36..d96bfe83e 100644
--- a/ipaserver/install/plugins/adtrust.py
+++ b/ipaserver/install/plugins/adtrust.py
@@ -19,11 +19,8 @@
from ipalib import api, errors
from ipalib import Updater
-from ipaplatform.paths import paths
from ipapython.dn import DN
from ipapython.ipa_log_manager import *
-from ipapython import sysrestore
-from ipaserver.install import installutils
DEFAULT_ID_RANGE_SIZE = 200000
diff --git a/ipaserver/install/plugins/dns.py b/ipaserver/install/plugins/dns.py
index 6d7c81c98..646ed23f3 100644
--- a/ipaserver/install/plugins/dns.py
+++ b/ipaserver/install/plugins/dns.py
@@ -17,7 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import ldap as _ldap
import re
import traceback
import time
diff --git a/ipaserver/install/plugins/fix_replica_agreements.py b/ipaserver/install/plugins/fix_replica_agreements.py
index 106f66a45..00f2415d4 100644
--- a/ipaserver/install/plugins/fix_replica_agreements.py
+++ b/ipaserver/install/plugins/fix_replica_agreements.py
@@ -17,9 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import os
-import pwd
-from ipapython import ipaldap
from ipaserver.install import replication
from ipalib import api
from ipalib import Updater
diff --git a/ipaserver/install/server/common.py b/ipaserver/install/server/common.py
index 00b05c9b3..637e56643 100644
--- a/ipaserver/install/server/common.py
+++ b/ipaserver/install/server/common.py
@@ -11,7 +11,6 @@ from ipapython.install.core import Knob
from ipalib.util import validate_domain_name
from ipaserver.install import bindinstance
from ipapython.ipautil import check_zone_overlap
-from ipapython.dnsutil import DNSName
VALID_SUBJECT_ATTRS = ['st', 'o', 'ou', 'dnqualifier', 'c',
'serialnumber', 'l', 'title', 'sn', 'givenname',
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index 831985d61..8a57886cd 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -17,7 +17,7 @@ import six
from ipapython import certmonger, ipaldap, ipautil, sysrestore
from ipapython.dn import DN
-from ipapython.install import common, core
+from ipapython.install import core
from ipapython.install.common import step
from ipapython.install.core import Knob
from ipapython.ipa_log_manager import root_logger
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
index 63fe02b5c..78e32ae9b 100644
--- a/ipaserver/install/server/replicainstall.py
+++ b/ipaserver/install/server/replicainstall.py
@@ -15,9 +15,8 @@ import socket
import sys
import tempfile
-from ipapython import certmonger, ipaldap, ipautil, sysrestore
+from ipapython import ipaldap, ipautil, sysrestore
from ipapython.dn import DN
-from ipapython.install import common, core
from ipapython.install.common import step
from ipapython.install.core import Knob
from ipapython.ipa_log_manager import root_logger
diff --git a/ipaserver/install/service.py b/ipaserver/install/service.py
index a2f40ef38..2f2e29ee8 100644
--- a/ipaserver/install/service.py
+++ b/ipaserver/install/service.py
@@ -20,7 +20,6 @@
import sys
import os, socket
import tempfile
-import time
import datetime
import traceback
diff --git a/ipaserver/install/upgradeinstance.py b/ipaserver/install/upgradeinstance.py
index 602e6ec49..12737ed11 100644
--- a/ipaserver/install/upgradeinstance.py
+++ b/ipaserver/install/upgradeinstance.py
@@ -18,15 +18,12 @@
#
import ldif
-import os
-import sys
import shutil
import random
import traceback
from ipaplatform.paths import paths
from ipaplatform import services
from ipapython.ipa_log_manager import *
-from ipapython import ipaldap
from ipaserver.install import installutils
from ipaserver.install import schemaupdate
diff --git a/ipaserver/plugins/dogtag.py b/ipaserver/plugins/dogtag.py
index 62ec1cce4..1a1172a38 100644
--- a/ipaserver/plugins/dogtag.py
+++ b/ipaserver/plugins/dogtag.py
@@ -241,8 +241,6 @@ digits and nothing else follows.
import datetime
import json
from lxml import etree
-import os
-import tempfile
import time
import pki
@@ -257,7 +255,6 @@ from ipapython.dn import DN
import ipapython.cookie
import ipapython.dogtag
from ipapython import ipautil
-from ipaserver.install.certs import CertDB
if six.PY3:
unicode = str
diff --git a/ipaserver/plugins/rabase.py b/ipaserver/plugins/rabase.py
index fae30ff2f..949f3c37e 100644
--- a/ipaserver/plugins/rabase.py
+++ b/ipaserver/plugins/rabase.py
@@ -30,10 +30,8 @@ certificates via the following methods:
* `ra.take_certificate_off_hold()` - take a certificate off hold.
"""
-from ipalib import api
from ipalib import Backend
from ipalib import errors
-from ipaserver.install import certs
import os
from ipaplatform.paths import paths
diff --git a/ipatests/i18n.py b/ipatests/i18n.py
index 813b78982..a83c5806e 100755
--- a/ipatests/i18n.py
+++ b/ipatests/i18n.py
@@ -26,7 +26,6 @@ from __future__ import print_function
import optparse
import sys
import gettext
-import locale
import re
import os
import traceback
diff --git a/ipatests/setup.py.in b/ipatests/setup.py.in
index ce1efb761..cb5f72255 100644
--- a/ipatests/setup.py.in
+++ b/ipatests/setup.py.in
@@ -25,7 +25,6 @@ DOCLINES = __doc__.split("\n")
import os
import sys
-import distutils.sysconfig
CLASSIFIERS = """\
Development Status :: 4 - Beta
diff --git a/ipatests/test_cmdline/test_cli.py b/ipatests/test_cmdline/test_cli.py
index ddc4c71a8..aeade0eda 100644
--- a/ipatests/test_cmdline/test_cli.py
+++ b/ipatests/test_cmdline/test_cli.py
@@ -8,7 +8,6 @@ from six import StringIO
from ipatests import util
from ipalib import api, errors
-from ipapython.version import API_VERSION
import pytest
if six.PY3:
diff --git a/ipatests/test_cmdline/test_help.py b/ipatests/test_cmdline/test_help.py
index fee942007..40b99c19c 100644
--- a/ipatests/test_cmdline/test_help.py
+++ b/ipatests/test_cmdline/test_help.py
@@ -18,9 +18,7 @@
#
import sys
-import contextlib
-from nose.tools import assert_raises # pylint: disable=E0611
import six
from six import StringIO
diff --git a/ipatests/test_cmdline/test_ipagetkeytab.py b/ipatests/test_cmdline/test_ipagetkeytab.py
index 37f4e4a7a..e712279bb 100644
--- a/ipatests/test_cmdline/test_ipagetkeytab.py
+++ b/ipatests/test_cmdline/test_ipagetkeytab.py
@@ -27,11 +27,9 @@ from ipalib import api
from ipalib import errors
import tempfile
from ipapython import ipautil, ipaldap
-import nose
import tempfile
import gssapi
from ipaserver.plugins.ldap2 import ldap2
-from ipapython.dn import DN
import pytest
def use_keytab(principal, keytab):
diff --git a/ipatests/test_integration/test_installation.py b/ipatests/test_integration/test_installation.py
index 925cc7d83..c3d194fb4 100644
--- a/ipatests/test_integration/test_installation.py
+++ b/ipatests/test_integration/test_installation.py
@@ -7,8 +7,6 @@ Module provides tests which testing ability of various subsystems to be
installed.
"""
-import time
-
from ipatests.test_integration.base import IntegrationTest
from ipatests.test_integration import tasks
diff --git a/ipatests/test_ipalib/test_backend.py b/ipatests/test_ipalib/test_backend.py
index f758d4ac7..6fb2d8558 100644
--- a/ipatests/test_ipalib/test_backend.py
+++ b/ipatests/test_ipalib/test_backend.py
@@ -31,7 +31,7 @@ from ipatests.util import ClassChecker, raises, create_test_api
from ipatests.data import unicode_str
from ipalib.request import context, Connection
from ipalib.frontend import Command
-from ipalib import backend, plugable, errors, base
+from ipalib import backend, plugable, errors
from ipapython.version import API_VERSION
import pytest
diff --git a/ipatests/test_ipalib/test_cli.py b/ipatests/test_ipalib/test_cli.py
index 3004e1f76..f03e155a7 100644
--- a/ipatests/test_ipalib/test_cli.py
+++ b/ipatests/test_ipalib/test_cli.py
@@ -21,8 +21,8 @@
Test the `ipalib.cli` module.
"""
-from ipatests.util import raises, get_api, ClassChecker
-from ipalib import cli, plugable, frontend, backend
+from ipatests.util import raises, ClassChecker
+from ipalib import cli, plugable
import pytest
diff --git a/ipatests/test_ipalib/test_config.py b/ipatests/test_ipalib/test_config.py
index 09885a578..22851559a 100644
--- a/ipatests/test_ipalib/test_config.py
+++ b/ipatests/test_ipalib/test_config.py
@@ -22,14 +22,12 @@
Test the `ipalib.config` module.
"""
-import os
from os import path
import sys
-import socket
-from ipatests.util import raises, setitem, delitem, ClassChecker
-from ipatests.util import getitem, setitem, delitem
+from ipatests.util import raises, delitem, ClassChecker
+from ipatests.util import getitem
from ipatests.util import TempDir, TempHome
-from ipalib.constants import TYPE_ERROR, OVERRIDE_ERROR, SET_ERROR, DEL_ERROR
+from ipalib.constants import OVERRIDE_ERROR, SET_ERROR, DEL_ERROR
from ipalib.constants import NAME_REGEX, NAME_ERROR
from ipalib import config, constants, base
from ipaplatform.paths import paths
diff --git a/ipatests/test_ipalib/test_crud.py b/ipatests/test_ipalib/test_crud.py
index c4b69c556..125b82465 100644
--- a/ipatests/test_ipalib/test_crud.py
+++ b/ipatests/test_ipalib/test_crud.py
@@ -21,8 +21,8 @@
Test the `ipalib.crud` module.
"""
-from ipatests.util import read_only, raises, get_api, ClassChecker
-from ipalib import crud, frontend, plugable, config
+from ipatests.util import raises, get_api, ClassChecker
+from ipalib import crud, frontend
from ipalib.parameters import Str
import pytest
diff --git a/ipatests/test_ipalib/test_errors.py b/ipatests/test_ipalib/test_errors.py
index 4dc84501b..7ad07b041 100644
--- a/ipatests/test_ipalib/test_errors.py
+++ b/ipatests/test_ipalib/test_errors.py
@@ -31,7 +31,7 @@ import pytest
import six
from ipatests.util import assert_equal, raises
-from ipalib import errors, text
+from ipalib import errors
from ipaplatform.paths import paths
from ipalib.constants import TYPE_ERROR
diff --git a/ipatests/test_ipalib/test_output.py b/ipatests/test_ipalib/test_output.py
index 927da74f3..5741637f9 100644
--- a/ipatests/test_ipalib/test_output.py
+++ b/ipatests/test_ipalib/test_output.py
@@ -24,7 +24,6 @@ Test the `ipalib.output` module.
from ipatests.util import raises, ClassChecker
from ipalib import output
from ipalib.frontend import Command
-from ipalib import _
from ipapython.version import API_VERSION
import pytest
diff --git a/ipatests/test_ipalib/test_plugable.py b/ipatests/test_ipalib/test_plugable.py
index 3e7e64bc8..0434d7970 100644
--- a/ipatests/test_ipalib/test_plugable.py
+++ b/ipatests/test_ipalib/test_plugable.py
@@ -24,12 +24,9 @@ Test the `ipalib.plugable` module.
# FIXME: Pylint errors
# pylint: disable=no-member
-import inspect
-from ipatests.util import raises, no_set, no_del, read_only
-from ipatests.util import getitem, setitem, delitem
+from ipatests.util import raises, read_only
from ipatests.util import ClassChecker, create_test_api
from ipalib import plugable, errors, text
-from ipaplatform.paths import paths
import pytest
diff --git a/ipatests/test_ipalib/test_text.py b/ipatests/test_ipalib/test_text.py
index acf0bc22c..bdc762335 100644
--- a/ipatests/test_ipalib/test_text.py
+++ b/ipatests/test_ipalib/test_text.py
@@ -25,17 +25,13 @@ from __future__ import print_function
import os
import shutil
import tempfile
-import re
import nose
-import locale
import six
import pytest
-from ipatests.util import raises, assert_equal
from ipatests.i18n import create_po, po_file_iterate
from ipalib.request import context
-from ipalib import request
from ipalib import text
from ipapython.ipautil import file_exists
diff --git a/ipatests/test_ipapython/test_cookie.py b/ipatests/test_ipapython/test_cookie.py
index 5b71b0745..97cb79a07 100644
--- a/ipatests/test_ipapython/test_cookie.py
+++ b/ipatests/test_ipapython/test_cookie.py
@@ -18,7 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
-import time
import datetime
import email.utils
import calendar
diff --git a/ipatests/test_ipapython/test_ipautil.py b/ipatests/test_ipapython/test_ipautil.py
index f91b730c5..1197d5ce5 100644
--- a/ipatests/test_ipapython/test_ipautil.py
+++ b/ipatests/test_ipapython/test_ipautil.py
@@ -22,8 +22,6 @@
Test the `ipapython/ipautil.py` module.
"""
-import sys
-
import nose
import pytest
import six
diff --git a/ipatests/test_ipapython/test_keyring.py b/ipatests/test_ipapython/test_keyring.py
index 02fd29e8c..e22841c8f 100644
--- a/ipatests/test_ipapython/test_keyring.py
+++ b/ipatests/test_ipapython/test_keyring.py
@@ -20,7 +20,7 @@
Test the `kernel_keyring.py` module.
"""
-from nose.tools import raises, assert_raises # pylint: disable=E0611
+from nose.tools import raises # pylint: disable=E0611
from ipapython import kernel_keyring
import pytest
diff --git a/ipatests/test_ipapython/test_ssh.py b/ipatests/test_ipapython/test_ssh.py
index 509d1a085..817ef057e 100644
--- a/ipatests/test_ipapython/test_ssh.py
+++ b/ipatests/test_ipapython/test_ssh.py
@@ -23,7 +23,6 @@ Test the `ipapython/ssh.py` module.
import base64
import six
-import nose
import pytest
from ipapython import ssh
diff --git a/ipatests/test_ipaserver/test_changepw.py b/ipatests/test_ipaserver/test_changepw.py
index 866ea5554..9c74f2ef3 100644
--- a/ipatests/test_ipaserver/test_changepw.py
+++ b/ipatests/test_ipaserver/test_changepw.py
@@ -23,7 +23,7 @@ import pytest
from ipatests.test_ipaserver.httptest import Unauthorized_HTTP_test
from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test
-from ipatests.util import assert_equal, assert_not_equal
+from ipatests.util import assert_equal
from ipalib import api, errors
from ipapython.dn import DN
diff --git a/ipatests/test_ipaserver/test_otptoken_import.py b/ipatests/test_ipaserver/test_otptoken_import.py
index 3325b0c5a..0969e02d5 100644
--- a/ipatests/test_ipaserver/test_otptoken_import.py
+++ b/ipatests/test_ipaserver/test_otptoken_import.py
@@ -18,8 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
-import sys
-import nose
import pytest
from nss import nss
from ipalib.x509 import initialize_nss_database
diff --git a/ipatests/test_ipaserver/test_rpcserver.py b/ipatests/test_ipaserver/test_rpcserver.py
index 976ebf7d6..03a4cebb2 100644
--- a/ipatests/test_ipaserver/test_rpcserver.py
+++ b/ipatests/test_ipaserver/test_rpcserver.py
@@ -26,9 +26,8 @@ import pytest
import six
-from ipatests.util import create_test_api, assert_equal, raises, PluginTester
-from ipatests.data import unicode_str
-from ipalib import errors, Command
+from ipatests.util import assert_equal, raises, PluginTester
+from ipalib import errors
from ipaserver import rpcserver
if six.PY3:
diff --git a/ipatests/test_webui/test_hostgroup.py b/ipatests/test_webui/test_hostgroup.py
index 1879bad8c..9b10de276 100644
--- a/ipatests/test_webui/test_hostgroup.py
+++ b/ipatests/test_webui/test_hostgroup.py
@@ -27,7 +27,6 @@ import ipatests.test_webui.data_hostgroup as hostgroup
from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY
import ipatests.test_webui.data_netgroup as netgroup
import ipatests.test_webui.data_hbac as hbac
-import ipatests.test_webui.test_rbac as rbac
import ipatests.test_webui.data_sudo as sudo
import pytest
diff --git a/ipatests/test_xmlrpc/test_automount_plugin.py b/ipatests/test_xmlrpc/test_automount_plugin.py
index 073dfcf14..929205692 100644
--- a/ipatests/test_xmlrpc/test_automount_plugin.py
+++ b/ipatests/test_xmlrpc/test_automount_plugin.py
@@ -21,7 +21,6 @@
Test the `ipalib/plugins/automount.py' module.
"""
-import sys
import textwrap
import tempfile
import shutil
@@ -34,7 +33,6 @@ import six
from nose.tools import raises, assert_raises # pylint: disable=E0611
from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test, assert_attr_equal
-from ipaplatform.paths import paths
from ipatests.util import assert_deepequal
if six.PY3:
diff --git a/ipatests/test_xmlrpc/test_batch_plugin.py b/ipatests/test_xmlrpc/test_batch_plugin.py
index ca042d347..92b4af54a 100644
--- a/ipatests/test_xmlrpc/test_batch_plugin.py
+++ b/ipatests/test_xmlrpc/test_batch_plugin.py
@@ -21,9 +21,9 @@
Test the `ipalib/plugins/batch.py` module.
"""
-from ipalib import api, errors
+from ipalib import api
from ipatests.test_xmlrpc import objectclasses
-from ipatests.util import assert_equal, Fuzzy, assert_deepequal
+from ipatests.util import Fuzzy, assert_deepequal
from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits,
fuzzy_uuid)
from ipapython.dn import DN
diff --git a/ipatests/test_xmlrpc/test_caacl_plugin.py b/ipatests/test_xmlrpc/test_caacl_plugin.py
index d5ded1951..85c7072a0 100644
--- a/ipatests/test_xmlrpc/test_caacl_plugin.py
+++ b/ipatests/test_xmlrpc/test_caacl_plugin.py
@@ -12,7 +12,6 @@ from ipalib import errors
from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test
# reuse the fixture
-from ipatests.test_xmlrpc.test_certprofile_plugin import default_profile
from ipatests.test_xmlrpc.tracker.caacl_plugin import CAACLTracker
from ipatests.test_xmlrpc.tracker.stageuser_plugin import StageUserTracker
diff --git a/ipatests/test_xmlrpc/test_cert_plugin.py b/ipatests/test_xmlrpc/test_cert_plugin.py
index f54a226e4..ba8dd4636 100644
--- a/ipatests/test_xmlrpc/test_cert_plugin.py
+++ b/ipatests/test_xmlrpc/test_cert_plugin.py
@@ -20,12 +20,11 @@
Test the `ipalib/plugins/cert.py` module against a RA.
"""
-import sys
import os
import shutil
from nose.tools import raises, assert_raises # pylint: disable=E0611
-from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test, assert_attr_equal
+from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test
from ipalib import api
from ipalib import errors
from ipalib import x509
diff --git a/ipatests/test_xmlrpc/test_config_plugin.py b/ipatests/test_xmlrpc/test_config_plugin.py
index 291b86a7e..2a9086f25 100644
--- a/ipatests/test_xmlrpc/test_config_plugin.py
+++ b/ipatests/test_xmlrpc/test_config_plugin.py
@@ -22,8 +22,7 @@ Test the `ipalib/plugins/config.py` module.
"""
from ipalib import errors
-from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits,
- fuzzy_uuid)
+from ipatests.test_xmlrpc.xmlrpc_test import Declarative
import pytest
diff --git a/ipatests/test_xmlrpc/test_delegation_plugin.py b/ipatests/test_xmlrpc/test_delegation_plugin.py
index 119822983..99a0bcdcb 100644
--- a/ipatests/test_xmlrpc/test_delegation_plugin.py
+++ b/ipatests/test_xmlrpc/test_delegation_plugin.py
@@ -22,9 +22,7 @@ Test the `ipalib/plugins/delegation.py` module.
"""
from ipalib import api, errors
-from ipatests.test_xmlrpc import objectclasses
-from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits,
- fuzzy_uuid)
+from ipatests.test_xmlrpc.xmlrpc_test import Declarative
from ipapython.dn import DN
import pytest
diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py
index 1ec10bf06..200c57d49 100644
--- a/ipatests/test_xmlrpc/test_dns_plugin.py
+++ b/ipatests/test_xmlrpc/test_dns_plugin.py
@@ -26,8 +26,7 @@ from ipalib.util import normalize_zone
from ipapython.dnsutil import DNSName
from ipapython.dn import DN
from ipatests.test_xmlrpc import objectclasses
-from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits,
- fuzzy_uuid)
+from ipatests.test_xmlrpc.xmlrpc_test import Declarative, fuzzy_digits
import pytest
try:
diff --git a/ipatests/test_xmlrpc/test_group_plugin.py b/ipatests/test_xmlrpc/test_group_plugin.py
index f2bd0f4b9..6eb57c12f 100644
--- a/ipatests/test_xmlrpc/test_group_plugin.py
+++ b/ipatests/test_xmlrpc/test_group_plugin.py
@@ -21,19 +21,20 @@
Test the `ipalib/plugins/group.py` module.
"""
-import functools
import pytest
from ipalib import api, errors
from ipatests.test_xmlrpc import objectclasses
-from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, fuzzy_uuid, fuzzy_set_ci,
- add_sid, add_oc, XMLRPC_test, raises_exact)
+from ipatests.test_xmlrpc.xmlrpc_test import (
+ Declarative,
+ fuzzy_digits,
+ fuzzy_uuid,
+ fuzzy_set_ci,
+ add_sid,
+ add_oc)
from ipapython.dn import DN
from ipatests.test_xmlrpc.test_user_plugin import get_user_result
-from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker
-from ipatests.util import assert_deepequal
-
group1 = u'testgroup1'
group2 = u'testgroup2'
diff --git a/ipatests/test_xmlrpc/test_hbactest_plugin.py b/ipatests/test_xmlrpc/test_hbactest_plugin.py
index 9b631a4b5..fba3bec8e 100644
--- a/ipatests/test_xmlrpc/test_hbactest_plugin.py
+++ b/ipatests/test_xmlrpc/test_hbactest_plugin.py
@@ -21,7 +21,7 @@
Test the `ipalib/plugins/hbactest.py` module.
"""
-from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test, assert_attr_equal
+from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test
from ipalib import api
from ipalib import errors
from nose.tools import raises
diff --git a/ipatests/test_xmlrpc/test_netgroup_plugin.py b/ipatests/test_xmlrpc/test_netgroup_plugin.py
index 611bdf2ff..c03566b12 100644
--- a/ipatests/test_xmlrpc/test_netgroup_plugin.py
+++ b/ipatests/test_xmlrpc/test_netgroup_plugin.py
@@ -21,11 +21,8 @@
Test the `ipalib/plugins/netgroup.py` module.
"""
-import nose
-
from ipalib import api
from ipalib import errors
-from ipaserver.plugins.ldap2 import ldap2
from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits,
fuzzy_uuid, fuzzy_netgroupdn)
from ipatests.test_xmlrpc import objectclasses
diff --git a/ipatests/test_xmlrpc/test_old_permission_plugin.py b/ipatests/test_xmlrpc/test_old_permission_plugin.py
index c7c300446..9e4b561a6 100644
--- a/ipatests/test_xmlrpc/test_old_permission_plugin.py
+++ b/ipatests/test_xmlrpc/test_old_permission_plugin.py
@@ -27,8 +27,7 @@ http://www.freeipa.org/page/V3/Permissions_V2
from ipalib import api, errors
from ipatests.test_xmlrpc import objectclasses
-from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits,
- fuzzy_uuid)
+from ipatests.test_xmlrpc.xmlrpc_test import Declarative
from ipapython.dn import DN
import pytest
diff --git a/ipatests/test_xmlrpc/test_passwd_plugin.py b/ipatests/test_xmlrpc/test_passwd_plugin.py
index 2945d7040..0ebe14c26 100644
--- a/ipatests/test_xmlrpc/test_passwd_plugin.py
+++ b/ipatests/test_xmlrpc/test_passwd_plugin.py
@@ -20,8 +20,6 @@
Test the `ipalib/plugins/passwd.py` module.
"""
-import sys
-
from nose.tools import assert_raises # pylint: disable=E0611
from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test, assert_attr_equal
diff --git a/ipatests/test_xmlrpc/test_ping_plugin.py b/ipatests/test_xmlrpc/test_ping_plugin.py
index e1c772ad6..afd34fa14 100644
--- a/ipatests/test_xmlrpc/test_ping_plugin.py
+++ b/ipatests/test_xmlrpc/test_ping_plugin.py
@@ -21,10 +21,9 @@
Test the `ipalib/plugins/ping.py` module, and XML-RPC in general.
"""
-from ipalib import api, errors, messages, _
+from ipalib import errors, _
from ipatests.util import Fuzzy
from ipatests.test_xmlrpc.xmlrpc_test import Declarative
-from ipapython.version import API_VERSION
import pytest
diff --git a/ipatests/test_xmlrpc/test_privilege_plugin.py b/ipatests/test_xmlrpc/test_privilege_plugin.py
index 148f7d1fe..ce9afe2fd 100644
--- a/ipatests/test_xmlrpc/test_privilege_plugin.py
+++ b/ipatests/test_xmlrpc/test_privilege_plugin.py
@@ -23,8 +23,7 @@ Test the `ipalib/plugins/privilege.py` module.
from ipalib import api, errors
from ipatests.test_xmlrpc import objectclasses
-from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits,
- fuzzy_uuid)
+from ipatests.test_xmlrpc.xmlrpc_test import Declarative
from ipapython.dn import DN
import pytest
diff --git a/ipatests/test_xmlrpc/test_role_plugin.py b/ipatests/test_xmlrpc/test_role_plugin.py
index 70b5f6165..d06daac69 100644
--- a/ipatests/test_xmlrpc/test_role_plugin.py
+++ b/ipatests/test_xmlrpc/test_role_plugin.py
@@ -24,8 +24,7 @@ Test the `ipalib/plugins/role.py` module.
from ipalib import api, errors
from ipatests.test_xmlrpc import objectclasses
-from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits,
- fuzzy_uuid)
+from ipatests.test_xmlrpc.xmlrpc_test import Declarative, fuzzy_uuid
from ipapython.dn import DN
import pytest
diff --git a/ipatests/test_xmlrpc/test_selfservice_plugin.py b/ipatests/test_xmlrpc/test_selfservice_plugin.py
index eed1a2d7e..9dd3916de 100644
--- a/ipatests/test_xmlrpc/test_selfservice_plugin.py
+++ b/ipatests/test_xmlrpc/test_selfservice_plugin.py
@@ -21,10 +21,8 @@
Test the `ipalib/plugins/selfservice.py` module.
"""
-from ipalib import api, errors
-from ipatests.test_xmlrpc import objectclasses
-from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits,
- fuzzy_uuid)
+from ipalib import errors
+from ipatests.test_xmlrpc.xmlrpc_test import Declarative
import pytest
selfservice1 = u'testself'
diff --git a/ipatests/test_xmlrpc/test_service_plugin.py b/ipatests/test_xmlrpc/test_service_plugin.py
index ecc5248a9..9bd082916 100644
--- a/ipatests/test_xmlrpc/test_service_plugin.py
+++ b/ipatests/test_xmlrpc/test_service_plugin.py
@@ -27,8 +27,7 @@ from ipatests.test_xmlrpc.xmlrpc_test import fuzzy_digits, fuzzy_date, fuzzy_iss
from ipatests.test_xmlrpc.xmlrpc_test import fuzzy_hex
from ipatests.test_xmlrpc import objectclasses
from ipatests.test_xmlrpc.testcert import get_testcert
-from ipatests.test_xmlrpc.test_user_plugin import (
- get_user_result, get_user_dn, get_group_dn)
+from ipatests.test_xmlrpc.test_user_plugin import get_user_result, get_group_dn
import base64
from ipapython.dn import DN
import pytest
diff --git a/ipatests/test_xmlrpc/test_stageuser_plugin.py b/ipatests/test_xmlrpc/test_stageuser_plugin.py
index 42ecf0468..b6744eb8e 100644
--- a/ipatests/test_xmlrpc/test_stageuser_plugin.py
+++ b/ipatests/test_xmlrpc/test_stageuser_plugin.py
@@ -6,11 +6,6 @@
Test the `ipalib/plugins/stageuser.py` module.
"""
-
-import datetime
-import ldap
-import re
-import functools
import pytest
import six
@@ -18,14 +13,8 @@ import six
from collections import OrderedDict
from ipalib import api, errors
-from ipatests.test_xmlrpc import objectclasses
-from ipatests.test_xmlrpc.xmlrpc_test import (
- XMLRPC_test, fuzzy_digits, fuzzy_uuid, fuzzy_password, fuzzy_string,
- fuzzy_dergeneralizedtime, add_sid, add_oc, raises_exact)
+from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test, raises_exact
-from ipatests.util import (
- assert_equal, assert_deepequal, assert_not_equal, raises, get_user_dn)
-from ipapython.dn import DN
from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker
from ipatests.test_xmlrpc.tracker.group_plugin import GroupTracker
from ipatests.test_xmlrpc.tracker.stageuser_plugin import StageUserTracker
diff --git a/ipatests/test_xmlrpc/test_vault_plugin.py b/ipatests/test_xmlrpc/test_vault_plugin.py
index 5a0acb170..c8d778583 100644
--- a/ipatests/test_xmlrpc/test_vault_plugin.py
+++ b/ipatests/test_xmlrpc/test_vault_plugin.py
@@ -22,7 +22,7 @@ Test the `ipalib/plugins/vault.py` module.
"""
import nose
-from ipalib import api, errors
+from ipalib import api
from ipatests.test_xmlrpc.xmlrpc_test import Declarative, fuzzy_string
import pytest
diff --git a/ipatests/test_xmlrpc/testcert.py b/ipatests/test_xmlrpc/testcert.py
index 620879205..b7abcdcec 100644
--- a/ipatests/test_xmlrpc/testcert.py
+++ b/ipatests/test_xmlrpc/testcert.py
@@ -34,7 +34,6 @@ from ipalib import api, x509
from ipaserver.plugins import rabase
from ipapython import ipautil
from ipaplatform.paths import paths
-from ipapython.dn import DN
if six.PY3:
unicode = str
diff --git a/ipatests/test_xmlrpc/tracker/stageuser_plugin.py b/ipatests/test_xmlrpc/tracker/stageuser_plugin.py
index 0f7eadd04..72edd3342 100644
--- a/ipatests/test_xmlrpc/tracker/stageuser_plugin.py
+++ b/ipatests/test_xmlrpc/tracker/stageuser_plugin.py
@@ -11,7 +11,7 @@ from ipatests.test_xmlrpc import objectclasses
from ipatests.test_xmlrpc.xmlrpc_test import (
fuzzy_string, fuzzy_dergeneralizedtime, raises_exact)
-from ipatests.util import assert_deepequal, get_user_dn
+from ipatests.util import assert_deepequal
from ipapython.dn import DN
if six.PY3:
diff --git a/make-lint b/make-lint
index 2cffe0938..04e985d52 100755
--- a/make-lint
+++ b/make-lint
@@ -239,8 +239,11 @@ def main():
linter.register_checker(IPATypeChecker(linter))
if options.errors_only:
- linter.disable_noerror_messages()
- linter.enable('F')
+ linter.set_option('disable', 'all')
+ linter.set_option('enable', 'F')
+ linter.set_option('enable', 'E')
+ linter.set_option('enable', 'unused-import')
+
linter.set_reporter(TextReporter())
linter.set_option('msg-template',
'{path}:{line}: [{msg_id}({symbol}), {obj}] {msg})')
diff --git a/makeaci b/makeaci
index 1ce8d143d..b63787ae5 100755
--- a/makeaci
+++ b/makeaci
@@ -32,7 +32,7 @@ from argparse import ArgumentParser
from ipalib import api
from ipapython.dn import DN
-from ipapython.ipaldap import LDAPEntry, LDAPClient
+from ipapython.ipaldap import LDAPClient
def parse_options():