Skip to content

Commit

Permalink
Merge pull request #398 from t-woerner/ipalib_facts_changes
Browse files Browse the repository at this point in the history
ipa[server,replica,client]: Fix moved sysrestore and is_ipa_configured
  • Loading branch information
rjeffman authored Sep 18, 2020
2 parents af37ad9 + e90ce38 commit 6c7f433
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
7 changes: 5 additions & 2 deletions roles/ipaclient/module_utils/ansible_ipa_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,12 @@ def knobs(self):
from ipalib import api, errors, x509
from ipalib import constants
try:
from ipalib.install import sysrestore
from ipalib import sysrestore
except ImportError:
from ipapython import sysrestore
try:
from ipalib.install import sysrestore
except ImportError:
from ipapython import sysrestore
try:
from ipalib.install import certmonger
except ImportError:
Expand Down
6 changes: 5 additions & 1 deletion roles/ipareplica/module_utils/ansible_ipa_replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@
from ipaserver.install.service import (
find_providing_servers, find_providing_server)
from ipaserver.install.installutils import (
ReplicaConfig, load_pkcs12, is_ipa_configured)
ReplicaConfig, load_pkcs12)
try:
from ipalib.facts import is_ipa_configured
except ImportError:
from ipaserver.install.installutils import is_ipa_configured
from ipaserver.install.replication import (
ReplicationManager, replica_conn_check)
from ipaserver.install.server.replicainstall import (
Expand Down
12 changes: 10 additions & 2 deletions roles/ipaserver/module_utils/ansible_ipa_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@
# IPA version >= 4.5

from ipaclient.install.ipachangeconf import IPAChangeConf
from ipalib.install import certmonger, sysrestore
from ipalib.install import certmonger
try:
from ipalib import sysrestore
except ImportError:
from ipalib.install import sysrestore
from ipapython import ipautil
from ipapython.ipa_log_manager import standard_logging_setup
try:
Expand Down Expand Up @@ -108,8 +112,12 @@
kra_imported = True
from ipaserver.install.installutils import (
BadHostError, get_fqdn, get_server_ip_address,
is_ipa_configured, load_pkcs12, read_password, verify_fqdn,
load_pkcs12, read_password, verify_fqdn,
update_hosts_file)
try:
from ipalib.facts import is_ipa_configured
except ImportError:
from ipaserver.install.installutils import is_ipa_configured
from ipaserver.install.server.install import (
check_dirsrv, validate_admin_password, validate_dm_password,
read_cache, write_cache)
Expand Down

0 comments on commit 6c7f433

Please sign in to comment.