Files
ansible-freeipa/roles/ipareplica/files/py3test.py
Thomas Woerner 1df12a614b ipareplica py3test: Try to import promote_check if install_check is not defined
Since FreeIPA version 4.7.1 there is no install_check defined anymore in
ipaserver.install.server.replicainstall.
2019-03-26 11:38:44 +01:00

13 lines
396 B
Python

#!/usr/bin/python3
# Test ipaerver python3 binding
try:
from ipaserver.install.server.replicainstall import install_check
except ImportError:
from ipaserver.install.server.replicainstall import promote_check
# Check ipapython version to be >= 4.6
from ipapython.version import NUM_VERSION, VERSION
if NUM_VERSION < 40590:
raise Exception("ipa %s not usable with python3" % VERSION)