Skip to content

Commit

Permalink
Add absolute_import future imports
Browse files Browse the repository at this point in the history
Add absolute_import from __future__ so that pylint
does not fail and to achieve python3 behavior in
python2.

Reviewed-By: Christian Heimes <[email protected]>
Reviewed-By: Alexander Bokovoy <[email protected]>
  • Loading branch information
stlaz committed Apr 20, 2018
1 parent 2de1aa2 commit b5bdd07
Show file tree
Hide file tree
Showing 121 changed files with 210 additions and 30 deletions.
1 change: 1 addition & 0 deletions install/migration/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"""
Password migration script
"""
from __future__ import absolute_import

import cgi
import errno
Expand Down
2 changes: 2 additions & 0 deletions install/share/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"""
WSGI appliction for IPA server.
"""
from __future__ import absolute_import

import logging
import os
import sys
Expand Down
1 change: 1 addition & 0 deletions install/wsgi/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"""
Plugin index generation script
"""
from __future__ import absolute_import

import logging
import os
Expand Down
2 changes: 2 additions & 0 deletions ipaclient/install/ipa_certupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from __future__ import absolute_import

import logging
import os
import tempfile
Expand Down
2 changes: 2 additions & 0 deletions ipaclient/install/ipa_client_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#

from __future__ import absolute_import

from ipaclient.install import client
from ipaplatform.paths import paths
from ipapython.install import cli
Expand Down
2 changes: 2 additions & 0 deletions ipaclient/install/ipadiscovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from __future__ import absolute_import

import logging
import operator
import socket
Expand Down
2 changes: 2 additions & 0 deletions ipaclient/install/timeconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# 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 __future__ import absolute_import

import logging
import os
import shutil
Expand Down
2 changes: 1 addition & 1 deletion ipalib/install/certmonger.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# This is used so we can add tracking to the Apache and 389-ds
# server certificates created during the IPA server installation.

from __future__ import print_function
from __future__ import print_function, absolute_import

import logging
import os
Expand Down
2 changes: 2 additions & 0 deletions ipalib/install/kinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#

from __future__ import absolute_import

import logging
import os
import time
Expand Down
2 changes: 2 additions & 0 deletions ipalib/install/sysrestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
# parts of the system configuration to the way it was
# before ipa-server-install was first run

from __future__ import absolute_import

import logging
import os
import os.path
Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/_importhook.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#
# Copyright (C) 2017 FreeIPA Contributors see COPYING for license
#
from __future__ import absolute_import

"""Meta import hook for ipaplatform.
Known Linux distros with /etc/os-release
Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/base/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
interacting with system services.
'''

from __future__ import absolute_import

import os
import json
import time
Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/base/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
This module contains default platform-specific implementations of system tasks.
'''

from __future__ import absolute_import

import logging

from pkg_resources import parse_version
Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
"""IpaMetaImporter replaces this module with ipaplatform.$NAME.constants.
"""
from __future__ import absolute_import

import ipaplatform._importhook

ipaplatform._importhook.fixup_module('ipaplatform.constants')
2 changes: 2 additions & 0 deletions ipaplatform/debian/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
'''

# Fallback to default path definitions
from __future__ import absolute_import

from ipaplatform.base.constants import BaseConstantsNamespace


Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/debian/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"""

# Fallback to default path definitions
from __future__ import absolute_import

from ipaplatform.base.paths import BasePathNamespace
import sysconfig

Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/debian/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Contains Debian-specific service class implementations.
"""

from __future__ import absolute_import

from ipaplatform.base import services as base_services
from ipaplatform.redhat import services as redhat_services
from ipapython import ipautil
Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/debian/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
This module contains default Debian-specific implementations of system tasks.
"""

from __future__ import absolute_import

from ipaplatform.base.tasks import BaseTaskNamespace
from ipaplatform.redhat.tasks import RedHatTaskNamespace

Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/fedora/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
'''

# Fallback to default constant definitions
from __future__ import absolute_import

from ipaplatform.redhat.constants import RedHatConstantsNamespace


Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/fedora/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
'''

# Fallback to default path definitions
from __future__ import absolute_import

from ipaplatform.redhat.paths import RedHatPathNamespace


Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/fedora/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
Contains Fedora-specific service class implementations.
"""

from __future__ import absolute_import

from ipaplatform.redhat import services as redhat_services

# Mappings from service names as FreeIPA code references to these services
Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/fedora/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
This module contains default Fedora-specific implementations of system tasks.
'''

from __future__ import absolute_import

from ipaplatform.redhat.tasks import RedHatTaskNamespace


Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
"""IpaMetaImporter replaces this module with ipaplatform.$NAME.paths.
"""
from __future__ import absolute_import

import ipaplatform._importhook

ipaplatform._importhook.fixup_module('ipaplatform.paths')
2 changes: 2 additions & 0 deletions ipaplatform/redhat/authconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# 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 __future__ import absolute_import

from ipaplatform.paths import paths
from ipapython import ipautil
from ipapython.admintool import ScriptError
Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/redhat/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
'''

# Fallback to default path definitions
from __future__ import absolute_import

from ipaplatform.base.constants import BaseConstantsNamespace


Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/redhat/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
common in Red Hat OS family-based systems.
'''

from __future__ import absolute_import

import sys

# Fallback to default path definitions
Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/redhat/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
Contains Red Hat OS family-specific service class implementations.
"""

from __future__ import absolute_import

import logging
import os
import time
Expand Down
2 changes: 1 addition & 1 deletion ipaplatform/redhat/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
This module contains default Red Hat OS family-specific implementations of
system tasks.
'''
from __future__ import print_function
from __future__ import print_function, absolute_import

import ctypes
import logging
Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/rhel/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
'''

# Fallback to default constant definitions
from __future__ import absolute_import

from ipaplatform.redhat.constants import RedHatConstantsNamespace


Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/rhel/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
'''

# Fallback to default path definitions
from __future__ import absolute_import

from ipaplatform.redhat.paths import RedHatPathNamespace


Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/rhel/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
Contains RHEL-specific service class implementations.
"""

from __future__ import absolute_import

from ipaplatform.redhat import services as redhat_services

# Mappings from service names as FreeIPA code references to these services
Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/rhel/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
This module contains default RHEL-specific implementations of system tasks.
'''

from __future__ import absolute_import

from ipaplatform.redhat.tasks import RedHatTaskNamespace


Expand Down
2 changes: 2 additions & 0 deletions ipaplatform/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
"""IpaMetaImporter replaces this module with ipaplatform.$NAME.services.
"""
from __future__ import absolute_import

import ipaplatform._importhook

ipaplatform._importhook.fixup_module('ipaplatform.services')
2 changes: 2 additions & 0 deletions ipaplatform/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
"""IpaMetaImporter replaces this module with ipaplatform.$NAME.tasks.
"""
from __future__ import absolute_import

import ipaplatform._importhook

ipaplatform._importhook.fixup_module('ipaplatform.tasks')
2 changes: 2 additions & 0 deletions ipapython/kernel_keyring.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from __future__ import absolute_import

import os
import six

Expand Down
2 changes: 1 addition & 1 deletion ipaserver/advise/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from __future__ import print_function
from __future__ import print_function, absolute_import

from contextlib import contextmanager
import logging
Expand Down
2 changes: 2 additions & 0 deletions ipaserver/advise/plugins/legacy_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# 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 __future__ import absolute_import

import os

from ipalib import api
Expand Down
2 changes: 2 additions & 0 deletions ipaserver/advise/plugins/smart_card_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Copyright (C) 2017 FreeIPA Contributors see COPYING for license
#

from __future__ import absolute_import

from ipalib.plugable import Registry
from ipaplatform import services
from ipaplatform.paths import paths
Expand Down
2 changes: 2 additions & 0 deletions ipaserver/dcerpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
# Make sure we only run this module at the server where samba4-python
# package is installed to avoid issues with unavailable modules

from __future__ import absolute_import

import logging
import re
import time
Expand Down
2 changes: 2 additions & 0 deletions ipaserver/dnssec/bindmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#

from __future__ import absolute_import

from datetime import datetime
import logging

Expand Down
2 changes: 2 additions & 0 deletions ipaserver/dnssec/keysyncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#

from __future__ import absolute_import

import logging

import ldap.dn
Expand Down
2 changes: 1 addition & 1 deletion ipaserver/dnssec/ldapkeydb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#

from __future__ import print_function
from __future__ import print_function, absolute_import

from binascii import hexlify
import collections
Expand Down
2 changes: 1 addition & 1 deletion ipaserver/dnssec/localhsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#

from __future__ import print_function
from __future__ import print_function, absolute_import

import collections
import os
Expand Down
2 changes: 1 addition & 1 deletion ipaserver/install/adtrust.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
AD trust installer module
"""

from __future__ import print_function
from __future__ import print_function, absolute_import

import logging
import os
Expand Down
Loading

0 comments on commit b5bdd07

Please sign in to comment.