Merge "Fix IPA v4.5.0 import issue with kinit_keytab"

This commit is contained in:
Jenkins 2017-09-14 07:08:14 +00:00 committed by Gerrit Code Review
commit fbf8fc0076
2 changed files with 12 additions and 7 deletions

View File

@ -20,13 +20,22 @@ try:
from gssapi.exceptions import GSSError
from ipalib import api
from ipalib import errors
from ipapython.ipautil import kinit_keytab
ipalib_imported = True
except ImportError:
# ipalib/ipapython are not available in PyPy yet, don't make it
# a showstopper for the tests.
ipalib_imported = False
if ipalib_imported:
try:
from ipapython.ipautil import kinit_keytab
except ImportError:
# The import moved in freeIPA 4.5.0
try:
from ipalib.install.kinit import kinit_keytab
except ImportError:
ipalib_imported = False
from novajoin.util import get_domain
from oslo_config import cfg
from oslo_log import log as logging

View File

@ -18,13 +18,9 @@ from novajoin.errors import ConfigurationError
from oslo_config import cfg
from oslo_log import log as logging
try:
from novajoin.ipa import ipalib_imported
if ipalib_imported:
from ipalib import api
ipalib_imported = True
except ImportError:
# ipalib/ipapython are not available in PyPi yet, don't make it
# a showstopper for the tests.
ipalib_imported = False
CONF = cfg.CONF