Fix import error by utilizing six and strict version spec

This commit is contained in:
Mark Gomersbach 2018-11-01 15:05:16 +01:00
parent 95174e66f4
commit 05c598c75e
No known key found for this signature in database
GPG Key ID: B5171AF93EC64F16
2 changed files with 9 additions and 17 deletions

View File

@ -19,14 +19,6 @@ from __future__ import absolute_import
import copy import copy
import logging import logging
import re import re
try:
if globals()['__builtins__'].reload:
pass
except AttributeError:
try:
from importlib import reload
except ImportError:
from imp import reload
# Import salt libs # Import salt libs
import salt.utils import salt.utils
@ -35,6 +27,10 @@ import salt.utils.systemd
from salt.exceptions import CommandExecutionError, MinionError from salt.exceptions import CommandExecutionError, MinionError
import salt.ext.six as six import salt.ext.six as six
# Workaround for 'reload' builtin of py2.7
if six.PY3:
from importlib import reload
# Import third party libs # Import third party libs
HAS_PORTAGE = False HAS_PORTAGE = False
try: try:

View File

@ -13,17 +13,13 @@ import logging
import re import re
import time import time
try:
if globals()['__builtins__'].reload:
pass
except AttributeError:
try:
from importlib import reload
except ImportError:
from imp import reload
# Import salt libs # Import salt libs
from salt.utils.timeout import wait_for from salt.utils.timeout import wait_for
import salt.ext.six as six
# Workaround for 'reload' builtin of py2.7
if six.PY3:
from importlib import reload
log = logging.getLogger(__name__) log = logging.getLogger(__name__)