library/ipadiscovery.py: Compatibilty to ipa 4.4 and later, new version check

freeipa 4.4 is the first version that supports all needed functions.
Therefore a check has been added to make sure that ipadiscovery fails for
versions before 4.4.

The python bindings of ipa versions before 4.6 are having a different
structure.
This commit is contained in:
Thomas Woerner
2017-09-14 13:29:56 +02:00
parent 4f06e9df65
commit 56063ae373

View File

@@ -162,9 +162,16 @@ if NUM_VERSION < 30201:
else:
IPA_PYTHON_VERSION = NUM_VERSION
from ipapython.dn import DN
from ipaclient.install import ipadiscovery
from ipalib.install.sysrestore import SYSRESTORE_STATEFILE
from ipaplatform.paths import paths
try:
from ipaclient.install import ipadiscovery
except ImportError:
from ipaclient import ipadiscovery
try:
from ipalib.install.sysrestore import SYSRESTORE_STATEFILE
except ImportError:
from ipapython.sysrestore import SYSRESTORE_STATEFILE
def get_cert_path(cert_path):
"""