From 7f8d79f637825c61922aba8952acb5eccf6956bb Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Jul 14 2017 07:12:36 +0000 Subject: ipatests: do not finalize api when IPA is not configured Pytest can be executed from a machine that doesn't have IPA configured. In this case, api can't be finalized because values such as basedn are unknown and missing. Fixes https://pagure.io/freeipa/issue/7046 Signed-off-by: Tomas Krizek Reviewed-By: Martin Basti --- diff --git a/ipatests/conftest.py b/ipatests/conftest.py index a57bf7d..c6c846e 100644 --- a/ipatests/conftest.py +++ b/ipatests/conftest.py @@ -18,6 +18,7 @@ except ImportError: ipaplatform = None try: import ipaserver + from ipaserver.install import installutils except ImportError: ipaserver = None @@ -105,7 +106,7 @@ def pytest_cmdline_main(config): # XXX workaround until https://fedorahosted.org/freeipa/ticket/6408 has # been resolved. - if ipaserver is not None: + if ipaserver is not None and installutils.is_ipa_configured(): api.finalize() if config.option.verbose: