From 60d1c36e17e5eda710d89e6c47c9a20bc5e131c0 Mon Sep 17 00:00:00 2001
From: Christian Heimes <cheimes@redhat.com>
Date: Sun, 16 Aug 2015 19:00:00 +0200
Subject: [PATCH 24/34] Py3 modernization: libmodernize.fixes.fix_import

Enforce absolute imports or explicit relative imports. Python 3 no
longer supports implicit relative imports, that is unqualified imports
from a module's directory. In order to load a module from the same
directory inside a package, use

    from . import module

The future feature 'from __future__ import absolute_import' ensures that
pki uses absolute imports on Python 2, too.

See https://www.python.org/dev/peps/pep-0328/
---
 base/common/python/conf.py                                            | 1 +
 base/common/python/pki/__init__.py                                    | 1 +
 base/common/python/pki/account.py                                     | 1 +
 base/common/python/pki/cert.py                                        | 1 +
 base/common/python/pki/cli.py                                         | 1 +
 base/common/python/pki/client.py                                      | 1 +
 base/common/python/pki/crypto.py                                      | 1 +
 base/common/python/pki/encoder.py                                     | 1 +
 base/common/python/pki/key.py                                         | 1 +
 base/common/python/pki/kra.py                                         | 1 +
 base/common/python/pki/profile.py                                     | 1 +
 base/common/python/pki/system.py                                      | 1 +
 base/common/python/pki/systemcert.py                                  | 1 +
 base/common/python/pki/upgrade.py                                     | 1 +
 base/common/python/pki/util.py                                        | 1 +
 base/common/sbin/pki-upgrade                                          | 1 +
 base/common/upgrade/10.0.1/01-AddJniJarDir                            | 1 +
 base/common/upgrade/10.0.3/01-RemoveJniJarDir                         | 1 +
 base/java-tools/bin/pki                                               | 1 +
 base/kra/functional/drmclient_deprecated.py                           | 1 +
 base/kra/functional/drmtest.py                                        | 1 +
 base/server/python/pki/server/__init__.py                             | 1 +
 base/server/python/pki/server/cli/instance.py                         | 1 +
 base/server/python/pki/server/cli/migrate.py                          | 1 +
 base/server/python/pki/server/cli/nuxwdog.py                          | 1 +
 base/server/python/pki/server/cli/subsystem.py                        | 1 +
 base/server/python/pki/server/deployment/pkihelper.py                 | 1 +
 base/server/python/pki/server/deployment/pkilogging.py                | 1 +
 base/server/python/pki/server/deployment/pkimanifest.py               | 1 +
 base/server/python/pki/server/deployment/pkiparser.py                 | 1 +
 base/server/python/pki/server/deployment/pkiscriptlet.py              | 1 +
 base/server/python/pki/server/deployment/scriptlets/configuration.py  | 1 +
 base/server/python/pki/server/deployment/scriptlets/finalization.py   | 2 ++
 .../python/pki/server/deployment/scriptlets/infrastructure_layout.py  | 2 ++
 base/server/python/pki/server/deployment/scriptlets/initialization.py | 2 ++
 .../server/python/pki/server/deployment/scriptlets/instance_layout.py | 1 +
 .../python/pki/server/deployment/scriptlets/security_databases.py     | 2 ++
 base/server/python/pki/server/deployment/scriptlets/selinux_setup.py  | 1 +
 .../python/pki/server/deployment/scriptlets/slot_substitution.py      | 2 ++
 .../python/pki/server/deployment/scriptlets/subsystem_layout.py       | 2 ++
 .../python/pki/server/deployment/scriptlets/webapp_deployment.py      | 1 +
 base/server/python/pki/server/upgrade.py                              | 1 +
 base/server/sbin/pki-server                                           | 1 +
 base/server/sbin/pki-server-upgrade                                   | 1 +
 base/server/sbin/pkidestroy                                           | 1 +
 base/server/sbin/pkispawn                                             | 1 +
 base/server/upgrade/10.0.1/01-ReplaceRandomNumberGenerator            | 1 +
 base/server/upgrade/10.0.1/02-CloningInterfaceChanges                 | 1 +
 base/server/upgrade/10.0.1/03-AddRestServlet                          | 1 +
 base/server/upgrade/10.0.5/01-EnableSessionInAuthenticator            | 1 +
 base/server/upgrade/10.0.99/01-FixJavaOpts                            | 1 +
 base/server/upgrade/10.0.99/02-RemoveAuthProperties                   | 1 +
 base/server/upgrade/10.0.99/03-FixRegistryFile                        | 1 +
 base/server/upgrade/10.0.99/04-FixLogFileOwnership                    | 1 +
 base/server/upgrade/10.1.1/01-MoveWebApplicationContextFile           | 1 +
 base/server/upgrade/10.1.99/01-MoveWebApplicationContextFile          | 1 +
 base/server/upgrade/10.1.99/02-ReplaceJettisonWithJackson             | 1 +
 base/server/upgrade/10.1.99/03-AddedRESTEasyClient                    | 1 +
 base/server/upgrade/10.1.99/04-ReplaceRESTEasyApplicationClass        | 1 +
 base/server/upgrade/10.1.99/05-RemoveConfigPathFromWebXML             | 1 +
 base/server/upgrade/10.2.1/01-AddTLSRangeSupport                      | 1 +
 base/server/upgrade/10.2.2/01-MoveWebApplicationDeploymentLocations   | 1 +
 base/server/upgrade/10.2.2/02-EnableWebApplicationAutoDeploy          | 1 +
 base/server/upgrade/10.2.2/03-RemoveDependencyOnJackson2              | 1 +
 base/server/upgrade/10.2.3/01-FixInstanceWorkFolderOwnership          | 1 +
 base/server/upgrade/10.2.3/02-FixBindPWPrompt                         | 1 +
 base/server/upgrade/10.2.4/01-AddMissingOCSPGETServletMappingToWebXML | 1 +
 base/server/upgrade/10.2.4/02-FixNuxwdogListenerClass                 | 1 +
 base/server/upgrade/10.2.5/01-AddKraAuditEvents                       | 1 +
 base/server/upgrade/10.2.6/01-RemoveInaccessableURLsFromServerXML     | 1 +
 base/server/upgrade/10.2.6/02-AddPhoneHomeURLsToTPSsServerXML         | 1 +
 scripts/pylint-build-scan.py                                          | 4 +++-
 setup.py                                                              | 1 +
 tox.ini                                                               | 2 +-
 74 files changed, 82 insertions(+), 2 deletions(-)

diff --git a/base/common/python/conf.py b/base/common/python/conf.py
index ba29afa414f20fe7d8aad6d173892659692b9914..0f81c95dccfec5e7ef5de13f9c4927c130718895 100644
--- a/base/common/python/conf.py
+++ b/base/common/python/conf.py
@@ -11,6 +11,7 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
+from __future__ import absolute_import
 import sys
 import os
 
diff --git a/base/common/python/pki/__init__.py b/base/common/python/pki/__init__.py
index 77e5b2365daad7dabd1fe9da95b4a25f7c09f158..a6f01ff82a164bda2783fc2eda4406d5f9075872 100644
--- a/base/common/python/pki/__init__.py
+++ b/base/common/python/pki/__init__.py
@@ -21,6 +21,7 @@
 """
 This module contains top-level classes and functions used by the Dogtag project.
 """
+from __future__ import absolute_import
 from functools import wraps
 import os
 import re
diff --git a/base/common/python/pki/account.py b/base/common/python/pki/account.py
index c8c7cd78b662e69ebb4294dbc3241d71cfa22071..9125df875331777733b626cf493bd46b634f40ce 100644
--- a/base/common/python/pki/account.py
+++ b/base/common/python/pki/account.py
@@ -18,6 +18,7 @@
 # Copyright (C) 2013 Red Hat, Inc.
 # All rights reserved.
 #
+from __future__ import absolute_import
 import pki
 
 
diff --git a/base/common/python/pki/cert.py b/base/common/python/pki/cert.py
index 575491ffeedf0d71d29438be536b5dc129c1ff16..5590b35eece2a7d6f258c8bffab961d5f2e6517f 100644
--- a/base/common/python/pki/cert.py
+++ b/base/common/python/pki/cert.py
@@ -20,6 +20,7 @@
 #     Abhishek Koneru <akoneru@redhat.com>
 #     Ade Lee <alee@redhat.com>
 
+from __future__ import absolute_import
 import copy
 import json
 
diff --git a/base/common/python/pki/cli.py b/base/common/python/pki/cli.py
index 12b8656e80f4682ce9460a2c96c9520d25b0df9d..dd8b388fb34c58b8f7385c2a630830bb417c68e0 100644
--- a/base/common/python/pki/cli.py
+++ b/base/common/python/pki/cli.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import collections
 import getopt
 import sys
diff --git a/base/common/python/pki/client.py b/base/common/python/pki/client.py
index d28a41d63e4b8b90edaa96088086643e847b4dc2..7f59c2f2ad436dc32f6186b3ba7e984cf625e3ba 100644
--- a/base/common/python/pki/client.py
+++ b/base/common/python/pki/client.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import functools
 import warnings
 
diff --git a/base/common/python/pki/crypto.py b/base/common/python/pki/crypto.py
index 2a33f06388e9b5d7d8e7f055e51da095cba88b4e..9c1c0f8816f6625486243f4aaa5476417c2f29a2 100644
--- a/base/common/python/pki/crypto.py
+++ b/base/common/python/pki/crypto.py
@@ -21,6 +21,7 @@
 """
 Module containing crypto classes.
 """
+from __future__ import absolute_import
 import abc
 import nss.nss as nss
 import os
diff --git a/base/common/python/pki/encoder.py b/base/common/python/pki/encoder.py
index 6d5725f0f63f333f52dafb00a4f4169b5626ded7..cebcc566b2e2533667c2979bdc6a0a62b1f5db03 100644
--- a/base/common/python/pki/encoder.py
+++ b/base/common/python/pki/encoder.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 import json
 
 TYPES = {}
diff --git a/base/common/python/pki/key.py b/base/common/python/pki/key.py
index 0df86865786d6350f270d7e9e720e7effcd11786..3433bce03df79a6bdeaf78e9298c23f1610ef9ce 100644
--- a/base/common/python/pki/key.py
+++ b/base/common/python/pki/key.py
@@ -24,6 +24,7 @@
 Module containing the Python client classes for the KeyClient and
 KeyRequestClient REST API on a DRM
 """
+from __future__ import absolute_import
 import base64
 import json
 import urllib
diff --git a/base/common/python/pki/kra.py b/base/common/python/pki/kra.py
index 9e46235d264a286b878005b2be49a4987e962b75..ca756c3c145ec420afc22e48231641b7e1aecc62 100644
--- a/base/common/python/pki/kra.py
+++ b/base/common/python/pki/kra.py
@@ -25,6 +25,7 @@ to interact with the DRM to expose the functionality of the KeyClient and
 KeyRequestResource REST APIs.
 """
 
+from __future__ import absolute_import
 import pki.key as key
 
 from pki.systemcert import SystemCertClient
diff --git a/base/common/python/pki/profile.py b/base/common/python/pki/profile.py
index 00318d0f293ddda171486e0163c223ef6ea2c369..70eec4083553d205fdd36399bf4507f3a3feafe8 100644
--- a/base/common/python/pki/profile.py
+++ b/base/common/python/pki/profile.py
@@ -17,6 +17,7 @@
 #
 # @author: Abhishek Koneru <akoneru@redhat.com>
 
+from __future__ import absolute_import
 import json
 import os
 
diff --git a/base/common/python/pki/system.py b/base/common/python/pki/system.py
index b3d5fc6412bbd232815c878f5bfd3caf57c21c6a..f1128fca1aced5bd9ec0200d02ba15cd69afa14e 100644
--- a/base/common/python/pki/system.py
+++ b/base/common/python/pki/system.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import pki.encoder as encoder
 import xml.etree.ElementTree as ETree
 import os
diff --git a/base/common/python/pki/systemcert.py b/base/common/python/pki/systemcert.py
index b5f7b03b8ea4bc377b4aedff1b7d708db759956b..4adc2f18e5e7d218df2696982faf6851587cde31 100644
--- a/base/common/python/pki/systemcert.py
+++ b/base/common/python/pki/systemcert.py
@@ -21,6 +21,7 @@
 """
 Module containing the Python client classes for the SystemCert REST API
 """
+from __future__ import absolute_import
 import base64
 import pki
 from pki.cert import CertData
diff --git a/base/common/python/pki/upgrade.py b/base/common/python/pki/upgrade.py
index 010f88c81dc03447350809f27a664afa4be44959..1206ef8baaf1c651b7c72bdaeebabbd8ba16db57 100644
--- a/base/common/python/pki/upgrade.py
+++ b/base/common/python/pki/upgrade.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import functools
 import os
 import re
diff --git a/base/common/python/pki/util.py b/base/common/python/pki/util.py
index 19f6be720ded0611cff33d72ded1295f7b130e38..55fa3b31769a13f7c0773335ed298dacb767901b 100644
--- a/base/common/python/pki/util.py
+++ b/base/common/python/pki/util.py
@@ -23,6 +23,7 @@ Module containing utility functions and classes for the Dogtag python code
 """
 
 
+from __future__ import absolute_import
 import os
 import shutil
 
diff --git a/base/common/sbin/pki-upgrade b/base/common/sbin/pki-upgrade
index 48b7c826b993113dc167b983cd494f0fe6ed32b0..72553ad5c1d2549514a26452c06f7c1d30d5deb3 100755
--- a/base/common/sbin/pki-upgrade
+++ b/base/common/sbin/pki-upgrade
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import getopt
 import signal
 import sys
diff --git a/base/common/upgrade/10.0.1/01-AddJniJarDir b/base/common/upgrade/10.0.1/01-AddJniJarDir
index 1419eb9e5c7bbe3789961dfe8ea3dc78eb7d2f1d..bc9d708b86f753f5af9ba361c81219df56b55f4c 100755
--- a/base/common/upgrade/10.0.1/01-AddJniJarDir
+++ b/base/common/upgrade/10.0.1/01-AddJniJarDir
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 
 import pki
diff --git a/base/common/upgrade/10.0.3/01-RemoveJniJarDir b/base/common/upgrade/10.0.3/01-RemoveJniJarDir
index 86ff54a6062e660e9655b38d4d3c577893646e47..6eb08e87cf40e5cfba6c8904a447710e50a7ff30 100755
--- a/base/common/upgrade/10.0.3/01-RemoveJniJarDir
+++ b/base/common/upgrade/10.0.3/01-RemoveJniJarDir
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 
 import pki
diff --git a/base/java-tools/bin/pki b/base/java-tools/bin/pki
index fc61f354b0db38f396fdac2e0c60300bdb346e0a..568093892584ef25d1c4d35addf86b8e0376d600 100644
--- a/base/java-tools/bin/pki
+++ b/base/java-tools/bin/pki
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import shlex
 import subprocess
 import sys
diff --git a/base/kra/functional/drmclient_deprecated.py b/base/kra/functional/drmclient_deprecated.py
index 33149bed7e9ad77817df38ad88aebf6c3172a06b..99c70a184629e489ac36a3bda98e42a79d562d7a 100644
--- a/base/kra/functional/drmclient_deprecated.py
+++ b/base/kra/functional/drmclient_deprecated.py
@@ -34,6 +34,7 @@ key, this data can be stored in and retrieved from the KRA.
 A sample test execution is provided at the end of the file.
 '''
 
+from __future__ import absolute_import
 from lxml import etree
 import nss.nss as nss
 import httplib
diff --git a/base/kra/functional/drmtest.py b/base/kra/functional/drmtest.py
index d951d5f25956d3675a97be7567e3760f7f91f6ab..1d7eb3270557c6cbc97b2a654165fa3c1d81e14d 100755
--- a/base/kra/functional/drmtest.py
+++ b/base/kra/functional/drmtest.py
@@ -32,6 +32,7 @@ Some setup is required to run the tests here successfully.
 See drmtest.readme.txt.
 """
 
+from __future__ import absolute_import
 import base64
 import getopt
 import random
diff --git a/base/server/python/pki/server/__init__.py b/base/server/python/pki/server/__init__.py
index 3a2cf6bef80fb1171f92c85625d51fe5a723e7e5..2f5fb461ff207a3e4b7bee8e3838848df9d97499 100644
--- a/base/server/python/pki/server/__init__.py
+++ b/base/server/python/pki/server/__init__.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 from lxml import etree
 import grp
 import os
diff --git a/base/server/python/pki/server/cli/instance.py b/base/server/python/pki/server/cli/instance.py
index 95a708bee73d8bcb26508ac92dbae7306bff04fa..f9e971e8aa4f8513c50940f875561e189f81864e 100644
--- a/base/server/python/pki/server/cli/instance.py
+++ b/base/server/python/pki/server/cli/instance.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import getopt
 import os
 import sys
diff --git a/base/server/python/pki/server/cli/migrate.py b/base/server/python/pki/server/cli/migrate.py
index de62a24b48370a93b9de44cfbb43d1b716796aab..32546204894143e52ba36c72ed23637b64f8f602 100644
--- a/base/server/python/pki/server/cli/migrate.py
+++ b/base/server/python/pki/server/cli/migrate.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import getopt
 import os
 import sys
diff --git a/base/server/python/pki/server/cli/nuxwdog.py b/base/server/python/pki/server/cli/nuxwdog.py
index d6ef91e436ddfdca36900a089908e40e174bb657..36ff3c5d544bab1d38ced83c1cc74bcc6aef137d 100644
--- a/base/server/python/pki/server/cli/nuxwdog.py
+++ b/base/server/python/pki/server/cli/nuxwdog.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import getopt
 import fileinput
 import os
diff --git a/base/server/python/pki/server/cli/subsystem.py b/base/server/python/pki/server/cli/subsystem.py
index a63eb86d75230ea3e330789d315e68809a499d9c..2f1e7e2f8c90d387cf93bd22506d7b9b6422e9de 100644
--- a/base/server/python/pki/server/cli/subsystem.py
+++ b/base/server/python/pki/server/cli/subsystem.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import getopt
 import os
 import sys
diff --git a/base/server/python/pki/server/deployment/pkihelper.py b/base/server/python/pki/server/deployment/pkihelper.py
index 62abce74e84abad4337ee9bb14b5796450372b9f..589da5c74f068adfb60c3cd9526bcd0c93e88e76 100644
--- a/base/server/python/pki/server/deployment/pkihelper.py
+++ b/base/server/python/pki/server/deployment/pkihelper.py
@@ -21,6 +21,7 @@
 #
 
 # System Imports
+from __future__ import absolute_import
 import errno
 import sys
 import os
diff --git a/base/server/python/pki/server/deployment/pkilogging.py b/base/server/python/pki/server/deployment/pkilogging.py
index 14c11cf4d8a9aa88a735c8f4fa8124b9a01b2886..6378ff06299f5ed366eb8bd7f3667758bc4d6466 100644
--- a/base/server/python/pki/server/deployment/pkilogging.py
+++ b/base/server/python/pki/server/deployment/pkilogging.py
@@ -20,6 +20,7 @@
 #
 
 # System Imports
+from __future__ import absolute_import
 import logging
 import os
 import pprint
diff --git a/base/server/python/pki/server/deployment/pkimanifest.py b/base/server/python/pki/server/deployment/pkimanifest.py
index 67b9348c1f411db109b9b6316b4fd14eaaea02b8..d959efb4a2503793ba7658a0fdfb7ed713f5f00a 100644
--- a/base/server/python/pki/server/deployment/pkimanifest.py
+++ b/base/server/python/pki/server/deployment/pkimanifest.py
@@ -20,6 +20,7 @@
 #
 
 # System Imports
+from __future__ import absolute_import
 import csv
 
 # PKI Deployment Imports
diff --git a/base/server/python/pki/server/deployment/pkiparser.py b/base/server/python/pki/server/deployment/pkiparser.py
index f192cc924b14d7016abe91c5f955fc06af65fc7a..5b1e4f2d24d19bff61e03f0c16c0c0f08ed6d258 100644
--- a/base/server/python/pki/server/deployment/pkiparser.py
+++ b/base/server/python/pki/server/deployment/pkiparser.py
@@ -20,6 +20,7 @@
 #
 
 # System Imports
+from __future__ import absolute_import
 import ConfigParser
 import argparse
 import getpass
diff --git a/base/server/python/pki/server/deployment/pkiscriptlet.py b/base/server/python/pki/server/deployment/pkiscriptlet.py
index c446c18f84a57af878e5be2256fa0d5626126818..e79231c60fb1b93021bb2c55e9791a8dbc20357e 100644
--- a/base/server/python/pki/server/deployment/pkiscriptlet.py
+++ b/base/server/python/pki/server/deployment/pkiscriptlet.py
@@ -20,6 +20,7 @@
 #
 
 # System Imports
+from __future__ import absolute_import
 import abc
 
 
diff --git a/base/server/python/pki/server/deployment/scriptlets/configuration.py b/base/server/python/pki/server/deployment/scriptlets/configuration.py
index fbcb1ccaa21001ec57f0fd9e7ffb00e062349ecc..c6e89023560fc92cb9bd451d9b7f05818807da8a 100644
--- a/base/server/python/pki/server/deployment/scriptlets/configuration.py
+++ b/base/server/python/pki/server/deployment/scriptlets/configuration.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import json
 
 # PKI Deployment Imports
diff --git a/base/server/python/pki/server/deployment/scriptlets/finalization.py b/base/server/python/pki/server/deployment/scriptlets/finalization.py
index b92965929ffa845ce10a667ff412e4dbcaf2393c..56ddf0219d37dc7258e95464aff9ae925456a1a8 100644
--- a/base/server/python/pki/server/deployment/scriptlets/finalization.py
+++ b/base/server/python/pki/server/deployment/scriptlets/finalization.py
@@ -19,6 +19,8 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
+
 # PKI Deployment Imports
 from .. import pkiconfig as config
 from .. import pkimanifest as manifest
diff --git a/base/server/python/pki/server/deployment/scriptlets/infrastructure_layout.py b/base/server/python/pki/server/deployment/scriptlets/infrastructure_layout.py
index 630ef38cc3ca72beb4596226d080f2e0358655f1..365bfb7637a0073fe068a1fa3b444d6663496cfc 100644
--- a/base/server/python/pki/server/deployment/scriptlets/infrastructure_layout.py
+++ b/base/server/python/pki/server/deployment/scriptlets/infrastructure_layout.py
@@ -19,6 +19,8 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
+
 # PKI Deployment Imports
 from .. import pkiconfig as config
 from .. import pkimessages as log
diff --git a/base/server/python/pki/server/deployment/scriptlets/initialization.py b/base/server/python/pki/server/deployment/scriptlets/initialization.py
index 378343eb57c5031825a76b8957f314eace6978dd..dae5a4b14d6cee09f884d22c7d75251b76211fb0 100644
--- a/base/server/python/pki/server/deployment/scriptlets/initialization.py
+++ b/base/server/python/pki/server/deployment/scriptlets/initialization.py
@@ -19,6 +19,8 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
+
 # PKI Deployment Imports
 from .. import pkiconfig as config
 from .. import pkimessages as log
diff --git a/base/server/python/pki/server/deployment/scriptlets/instance_layout.py b/base/server/python/pki/server/deployment/scriptlets/instance_layout.py
index 6cd98bb359b7f2747a27726caca161670aa01668..4ed50514352ca09aa79e8ce04ee6d824ed93f594 100644
--- a/base/server/python/pki/server/deployment/scriptlets/instance_layout.py
+++ b/base/server/python/pki/server/deployment/scriptlets/instance_layout.py
@@ -20,6 +20,7 @@
 #
 
 # System Imports
+from __future__ import absolute_import
 import os
 
 # PKI Deployment Imports
diff --git a/base/server/python/pki/server/deployment/scriptlets/security_databases.py b/base/server/python/pki/server/deployment/scriptlets/security_databases.py
index 3ffe452bbe85ff67029fffc7e6bd3d099676db59..27285dd3eaa61d788a6fb6047911b9bb9fc878a9 100644
--- a/base/server/python/pki/server/deployment/scriptlets/security_databases.py
+++ b/base/server/python/pki/server/deployment/scriptlets/security_databases.py
@@ -19,6 +19,8 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
+
 # PKI Deployment Imports
 from .. import pkiconfig as config
 from .. import pkimessages as log
diff --git a/base/server/python/pki/server/deployment/scriptlets/selinux_setup.py b/base/server/python/pki/server/deployment/scriptlets/selinux_setup.py
index 7075f6e5680f0bb4bfbc6979e76f7bfd176cb68f..0fa3e6c113145e439d078c6274915a6203b26f45 100644
--- a/base/server/python/pki/server/deployment/scriptlets/selinux_setup.py
+++ b/base/server/python/pki/server/deployment/scriptlets/selinux_setup.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import selinux
 import time
 if selinux.is_selinux_enabled():
diff --git a/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py b/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py
index cbcd7e34254e79a65fe93959cedff2946b547b7b..b35989cc962f1ae0d3abb39ee2a4e29f5be02b1f 100644
--- a/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py
+++ b/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py
@@ -19,6 +19,8 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
+
 # PKI Deployment Imports
 from .. import pkiconfig as config
 from .. import pkimessages as log
diff --git a/base/server/python/pki/server/deployment/scriptlets/subsystem_layout.py b/base/server/python/pki/server/deployment/scriptlets/subsystem_layout.py
index 2cad0cf4a6fb0c2f3af779b645d57ba6fe777949..598a235c9caefdff3f54fcafda602e1003c44b6c 100644
--- a/base/server/python/pki/server/deployment/scriptlets/subsystem_layout.py
+++ b/base/server/python/pki/server/deployment/scriptlets/subsystem_layout.py
@@ -19,6 +19,8 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
+
 # PKI Deployment Imports
 from .. import pkiconfig as config
 from .. import pkimessages as log
diff --git a/base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py b/base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py
index edbfafab34f85db945bb83ac8e061a5a05f1a88b..2dafe6f8188b2dd9676a4a4c087b155dd71129d3 100644
--- a/base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py
+++ b/base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py
@@ -20,6 +20,7 @@
 #
 
 # System Imports
+from __future__ import absolute_import
 import os
 
 # PKI Deployment Imports
diff --git a/base/server/python/pki/server/upgrade.py b/base/server/python/pki/server/upgrade.py
index c1ee0e7b17f3d35323c74d88301c627265eed675..cc9db48e4514894f03ad45b09156dfc07f1a5b45 100644
--- a/base/server/python/pki/server/upgrade.py
+++ b/base/server/python/pki/server/upgrade.py
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 import traceback
 
diff --git a/base/server/sbin/pki-server b/base/server/sbin/pki-server
index 2afaaa547531af787c951141cd1b46f0aee448cc..ad70a4838ac8fb88a25d655e286e169b208c89f0 100644
--- a/base/server/sbin/pki-server
+++ b/base/server/sbin/pki-server
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import getopt
 import sys
 
diff --git a/base/server/sbin/pki-server-upgrade b/base/server/sbin/pki-server-upgrade
index d149bc0456e98108add91f81d5a22f9baf550de8..6f4bed80279d1d29af0c9f8c7123faecd2994b7d 100755
--- a/base/server/sbin/pki-server-upgrade
+++ b/base/server/sbin/pki-server-upgrade
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import getopt
 import signal
 import sys
diff --git a/base/server/sbin/pkidestroy b/base/server/sbin/pkidestroy
index fa5232e103dab6aaf6cebe1d8d074cb0c568035e..252c504da7f4a52edf13d14c7df2ada72fd8e057 100755
--- a/base/server/sbin/pkidestroy
+++ b/base/server/sbin/pkidestroy
@@ -20,6 +20,7 @@
 #
 
 # System Imports
+from __future__ import absolute_import
 import sys
 import signal
 
diff --git a/base/server/sbin/pkispawn b/base/server/sbin/pkispawn
index 760febee2b68dcb9abad48b31b2f080ce89b561e..5666531c6cc68bdbb930c53aea1c1ea03ceff6ed 100755
--- a/base/server/sbin/pkispawn
+++ b/base/server/sbin/pkispawn
@@ -20,6 +20,7 @@
 #
 
 # System Imports
+from __future__ import absolute_import
 import sys
 import signal
 
diff --git a/base/server/upgrade/10.0.1/01-ReplaceRandomNumberGenerator b/base/server/upgrade/10.0.1/01-ReplaceRandomNumberGenerator
index 7b477da0b9144a90f7d3633da8df3dd4f9e1a51e..11b3794654f6e67310b8e637c1934c9c8a606a8c 100755
--- a/base/server/upgrade/10.0.1/01-ReplaceRandomNumberGenerator
+++ b/base/server/upgrade/10.0.1/01-ReplaceRandomNumberGenerator
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 import shutil
 from lxml import etree
diff --git a/base/server/upgrade/10.0.1/02-CloningInterfaceChanges b/base/server/upgrade/10.0.1/02-CloningInterfaceChanges
index 3c77b424e91340ec7ddc018bfe1c8b235c9e53b9..c4ae48effd8f317424c02d8431c46014d10fd129 100755
--- a/base/server/upgrade/10.0.1/02-CloningInterfaceChanges
+++ b/base/server/upgrade/10.0.1/02-CloningInterfaceChanges
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 from lxml import etree as ET
 
diff --git a/base/server/upgrade/10.0.1/03-AddRestServlet b/base/server/upgrade/10.0.1/03-AddRestServlet
index 46559373d099800c3e28ac8f90464d259043de65..285942a8f9944b62e280c50670fd620c5e718694 100755
--- a/base/server/upgrade/10.0.1/03-AddRestServlet
+++ b/base/server/upgrade/10.0.1/03-AddRestServlet
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 from lxml import etree as ET
 
diff --git a/base/server/upgrade/10.0.5/01-EnableSessionInAuthenticator b/base/server/upgrade/10.0.5/01-EnableSessionInAuthenticator
index 53d97ab010ce32dbcc5f7a75dcee7d2d7a9ecc35..36b22697b2fda16d852380d5d915959ea962690a 100755
--- a/base/server/upgrade/10.0.5/01-EnableSessionInAuthenticator
+++ b/base/server/upgrade/10.0.5/01-EnableSessionInAuthenticator
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 from lxml import etree
 
diff --git a/base/server/upgrade/10.0.99/01-FixJavaOpts b/base/server/upgrade/10.0.99/01-FixJavaOpts
index 8b5187397b549df3a31ec07efab71b9500da0c9f..3eada779db51d01640a18aad309060b4983bde5c 100755
--- a/base/server/upgrade/10.0.99/01-FixJavaOpts
+++ b/base/server/upgrade/10.0.99/01-FixJavaOpts
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import re
 import pki.server.upgrade
 
diff --git a/base/server/upgrade/10.0.99/02-RemoveAuthProperties b/base/server/upgrade/10.0.99/02-RemoveAuthProperties
index b5894fafeab7dc7d9ebc6e9762a3a7641c5b0f61..fb132437c17f3b9a480c6f659dbe214cf0d949b9 100755
--- a/base/server/upgrade/10.0.99/02-RemoveAuthProperties
+++ b/base/server/upgrade/10.0.99/02-RemoveAuthProperties
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 import pki
 import pki.server.upgrade
diff --git a/base/server/upgrade/10.0.99/03-FixRegistryFile b/base/server/upgrade/10.0.99/03-FixRegistryFile
index ae417578a3926d6ad42b10b34923249713b86ccb..3fbadb1147470c704b3ece2ed6dc937d6d993a2c 100755
--- a/base/server/upgrade/10.0.99/03-FixRegistryFile
+++ b/base/server/upgrade/10.0.99/03-FixRegistryFile
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 import re
 import pki.server
diff --git a/base/server/upgrade/10.0.99/04-FixLogFileOwnership b/base/server/upgrade/10.0.99/04-FixLogFileOwnership
index 964d50b7d7660b9ead11481bf4dd0239c4157b16..0daec4b3d2203ca0f13b4a113580f67ff2c3a3a5 100755
--- a/base/server/upgrade/10.0.99/04-FixLogFileOwnership
+++ b/base/server/upgrade/10.0.99/04-FixLogFileOwnership
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 import pki.server.upgrade
 
diff --git a/base/server/upgrade/10.1.1/01-MoveWebApplicationContextFile b/base/server/upgrade/10.1.1/01-MoveWebApplicationContextFile
index 7fa6c937e0ba1fa21a66c4cb50ec83958a403573..250b3f6f4540a38bcfd623a5eb9991af906bd894 100755
--- a/base/server/upgrade/10.1.1/01-MoveWebApplicationContextFile
+++ b/base/server/upgrade/10.1.1/01-MoveWebApplicationContextFile
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 
 import pki.server.upgrade
diff --git a/base/server/upgrade/10.1.99/01-MoveWebApplicationContextFile b/base/server/upgrade/10.1.99/01-MoveWebApplicationContextFile
index 7fa6c937e0ba1fa21a66c4cb50ec83958a403573..250b3f6f4540a38bcfd623a5eb9991af906bd894 100755
--- a/base/server/upgrade/10.1.99/01-MoveWebApplicationContextFile
+++ b/base/server/upgrade/10.1.99/01-MoveWebApplicationContextFile
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 
 import pki.server.upgrade
diff --git a/base/server/upgrade/10.1.99/02-ReplaceJettisonWithJackson b/base/server/upgrade/10.1.99/02-ReplaceJettisonWithJackson
index 2da03a600b30f49db14e79fd3125fa477f2b0023..9e4fb4c124140d29366d93ac91587ee6db6411cd 100755
--- a/base/server/upgrade/10.1.99/02-ReplaceJettisonWithJackson
+++ b/base/server/upgrade/10.1.99/02-ReplaceJettisonWithJackson
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 import subprocess
 
diff --git a/base/server/upgrade/10.1.99/03-AddedRESTEasyClient b/base/server/upgrade/10.1.99/03-AddedRESTEasyClient
index e9a720eafdc55a4e9e8e62e3df13bfc5b167dffc..40169bc66f597e755367daa90ca9fd9576d2d2a7 100755
--- a/base/server/upgrade/10.1.99/03-AddedRESTEasyClient
+++ b/base/server/upgrade/10.1.99/03-AddedRESTEasyClient
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 import subprocess
 
diff --git a/base/server/upgrade/10.1.99/04-ReplaceRESTEasyApplicationClass b/base/server/upgrade/10.1.99/04-ReplaceRESTEasyApplicationClass
index 1cfff29f66ad15cfef8aaa609e39f0fd8eba6ea1..efa43e503cbd0f05a24c09b1c36599f15898c5ca 100755
--- a/base/server/upgrade/10.1.99/04-ReplaceRESTEasyApplicationClass
+++ b/base/server/upgrade/10.1.99/04-ReplaceRESTEasyApplicationClass
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 from lxml import etree as ET
 
diff --git a/base/server/upgrade/10.1.99/05-RemoveConfigPathFromWebXML b/base/server/upgrade/10.1.99/05-RemoveConfigPathFromWebXML
index 4117b7e6a5b518fe21665d03e6838e11c2f2202f..3e1d47e2e1fb34ec1a4e2c1577c94722a85a35dd 100755
--- a/base/server/upgrade/10.1.99/05-RemoveConfigPathFromWebXML
+++ b/base/server/upgrade/10.1.99/05-RemoveConfigPathFromWebXML
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 from lxml import etree
 
diff --git a/base/server/upgrade/10.2.1/01-AddTLSRangeSupport b/base/server/upgrade/10.2.1/01-AddTLSRangeSupport
index c9db5503bb33da96a927ba26e908b31da35d952a..4a3997fce3051435c35720d835d06f3e5c0e1d0c 100755
--- a/base/server/upgrade/10.2.1/01-AddTLSRangeSupport
+++ b/base/server/upgrade/10.2.1/01-AddTLSRangeSupport
@@ -20,6 +20,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 from lxml import etree
 
diff --git a/base/server/upgrade/10.2.2/01-MoveWebApplicationDeploymentLocations b/base/server/upgrade/10.2.2/01-MoveWebApplicationDeploymentLocations
index 5689f252607f310fbd412a04c2bd2cea4ab24969..313ee0d7174503ae01c1515c93c0dad803d9d30e 100755
--- a/base/server/upgrade/10.2.2/01-MoveWebApplicationDeploymentLocations
+++ b/base/server/upgrade/10.2.2/01-MoveWebApplicationDeploymentLocations
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 import shutil
 from lxml import etree
diff --git a/base/server/upgrade/10.2.2/02-EnableWebApplicationAutoDeploy b/base/server/upgrade/10.2.2/02-EnableWebApplicationAutoDeploy
index 5493e1e21e79cab0e45587bdef1e6e8f55cb3bcc..ffa94d81c2973b363bfb1034057a4faa483562e5 100755
--- a/base/server/upgrade/10.2.2/02-EnableWebApplicationAutoDeploy
+++ b/base/server/upgrade/10.2.2/02-EnableWebApplicationAutoDeploy
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 from lxml import etree
 
diff --git a/base/server/upgrade/10.2.2/03-RemoveDependencyOnJackson2 b/base/server/upgrade/10.2.2/03-RemoveDependencyOnJackson2
index 0c66eadaa449fdec1aef188a1a7505178a73c3c7..946a1c354050ad5d8ac949a175b4df4c839e3e0d 100755
--- a/base/server/upgrade/10.2.2/03-RemoveDependencyOnJackson2
+++ b/base/server/upgrade/10.2.2/03-RemoveDependencyOnJackson2
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 
 import pki.server.upgrade
diff --git a/base/server/upgrade/10.2.3/01-FixInstanceWorkFolderOwnership b/base/server/upgrade/10.2.3/01-FixInstanceWorkFolderOwnership
index 83ec67d6b2131a874b11450d68d50b8462265eb9..8aa3f29ff418a21edc7ba204b3f0e9ce7e03b899 100755
--- a/base/server/upgrade/10.2.3/01-FixInstanceWorkFolderOwnership
+++ b/base/server/upgrade/10.2.3/01-FixInstanceWorkFolderOwnership
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 import pki.server.upgrade
 
diff --git a/base/server/upgrade/10.2.3/02-FixBindPWPrompt b/base/server/upgrade/10.2.3/02-FixBindPWPrompt
index ede12f462f78896130755d734ee043aa42d2d995..3157aa795fd9181a7e0e43b1216aabef33e80fee 100755
--- a/base/server/upgrade/10.2.3/02-FixBindPWPrompt
+++ b/base/server/upgrade/10.2.3/02-FixBindPWPrompt
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import fileinput
 import os
 import re
diff --git a/base/server/upgrade/10.2.4/01-AddMissingOCSPGETServletMappingToWebXML b/base/server/upgrade/10.2.4/01-AddMissingOCSPGETServletMappingToWebXML
index 5e4077371409fd862fb462a46f0a52b196e1580a..8d6a40d3e9f1b5c22221843d747c6e5af6a550eb 100755
--- a/base/server/upgrade/10.2.4/01-AddMissingOCSPGETServletMappingToWebXML
+++ b/base/server/upgrade/10.2.4/01-AddMissingOCSPGETServletMappingToWebXML
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 from lxml import etree as ET
 
diff --git a/base/server/upgrade/10.2.4/02-FixNuxwdogListenerClass b/base/server/upgrade/10.2.4/02-FixNuxwdogListenerClass
index 2eb381db363d4068010074dbcb0276fa89b5d487..3a6a3dbdd83a8504a70f6f96751db2ac041f6b33 100755
--- a/base/server/upgrade/10.2.4/02-FixNuxwdogListenerClass
+++ b/base/server/upgrade/10.2.4/02-FixNuxwdogListenerClass
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import subprocess
 
 import pki.server.upgrade
diff --git a/base/server/upgrade/10.2.5/01-AddKraAuditEvents b/base/server/upgrade/10.2.5/01-AddKraAuditEvents
index 389bd718e6911370e86c4dda8616630a3d50a358..e05c919a5a1bc6c8c723056c68f75b5573793fff 100644
--- a/base/server/upgrade/10.2.5/01-AddKraAuditEvents
+++ b/base/server/upgrade/10.2.5/01-AddKraAuditEvents
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 
 import pki
diff --git a/base/server/upgrade/10.2.6/01-RemoveInaccessableURLsFromServerXML b/base/server/upgrade/10.2.6/01-RemoveInaccessableURLsFromServerXML
index 8fd67271ce36a95d6a46ec2c74283d9b65c61e6c..6de2521a5e341e93f553304334787298d6edae8b 100755
--- a/base/server/upgrade/10.2.6/01-RemoveInaccessableURLsFromServerXML
+++ b/base/server/upgrade/10.2.6/01-RemoveInaccessableURLsFromServerXML
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import subprocess
 
 import pki.server.upgrade
diff --git a/base/server/upgrade/10.2.6/02-AddPhoneHomeURLsToTPSsServerXML b/base/server/upgrade/10.2.6/02-AddPhoneHomeURLsToTPSsServerXML
index 8dee70db609c2a298872b6c5a9e04fd2cf0b5e35..07a5b296ee3ac7b82c38cde2e26a3e2e4b57b90d 100755
--- a/base/server/upgrade/10.2.6/02-AddPhoneHomeURLsToTPSsServerXML
+++ b/base/server/upgrade/10.2.6/02-AddPhoneHomeURLsToTPSsServerXML
@@ -19,6 +19,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 
 import pki.server.upgrade
diff --git a/scripts/pylint-build-scan.py b/scripts/pylint-build-scan.py
index be036088ffb6bdb86d9b1972be34ce81bbac6a3e..e0db8fcb35c78667d5e32d0eaee0a1f72505a509 100755
--- a/scripts/pylint-build-scan.py
+++ b/scripts/pylint-build-scan.py
@@ -19,7 +19,9 @@
 # Copyright (C) 2015 Red Hat, Inc.
 # All rights reserved.
 
-from __future__ import print_function, unicode_literals
+from __future__ import absolute_import
+from __future__ import print_function
+from __future__ import unicode_literals
 
 import argparse
 import os
diff --git a/setup.py b/setup.py
index 504f8e7694c2f080e4b960878cfb552a54108f80..005000668bfe406e7a22004b0389edc2047f00ba 100644
--- a/setup.py
+++ b/setup.py
@@ -18,6 +18,7 @@
 # All rights reserved.
 #
 
+from __future__ import absolute_import
 import os
 import re
 from distutils.core import setup
diff --git a/tox.ini b/tox.ini
index ea7a789089adb47760a02867cddc5c3032326d98..95fddb8c265ad3b43907475b811e1ae168aa7d37 100644
--- a/tox.ini
+++ b/tox.ini
@@ -19,7 +19,7 @@
 #
 
 [tox]
-envlist = py27,lint,docs
+envlist = py27,pep8,lint,docs
 
 [testenv]
 # force installation of sphinx and lint in virtual env, otherwise
-- 
2.4.3

