95ea96
From f637bcbe1066eec41e90b99d7a4ab12288f08a74 Mon Sep 17 00:00:00 2001
95ea96
From: Christian Heimes <cheimes@redhat.com>
95ea96
Date: Fri, 6 Jul 2018 15:07:27 +0200
95ea96
Subject: [PATCH] Fix CA topology warning
95ea96
95ea96
Commit 7284097eedef70dd556270732e6ab8e23501ce09 kept
95ea96
find_providing_servers('CA') call before enable_services(). Therefore the
95ea96
list of known CA servers did not contain the current replica.
95ea96
ipa-replica-install on the first replica with --setup-ca still printed
95ea96
the CA topology warning.
95ea96
95ea96
See: https://pagure.io/freeipa/issue/7566
95ea96
Signed-off-by: Christian Heimes <cheimes@redhat.com>
95ea96
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
95ea96
---
95ea96
 ipaserver/install/server/replicainstall.py | 3 +--
95ea96
 ipaserver/install/service.py               | 4 ++--
95ea96
 2 files changed, 3 insertions(+), 4 deletions(-)
95ea96
95ea96
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
95ea96
index 0bf3568a300a133fa505dc8fc339c6677f9c5f73..387d4ca85d9ad41db3ce2d9bc2ae67ba11836ada 100644
95ea96
--- a/ipaserver/install/server/replicainstall.py
95ea96
+++ b/ipaserver/install/server/replicainstall.py
95ea96
@@ -1524,8 +1524,6 @@ def install(installer):
95ea96
     if options.setup_adtrust:
95ea96
         adtrust.install(False, options, fstore, api)
95ea96
 
95ea96
-    ca_servers = service.find_providing_servers('CA', api.Backend.ldap2, api)
95ea96
-
95ea96
     if not promote:
95ea96
         # Call client install script
95ea96
         service.print_msg("Configuring client side components")
95ea96
@@ -1556,6 +1554,7 @@ def install(installer):
95ea96
     # Enable configured services and update DNS SRV records
95ea96
     service.enable_services(config.host_name)
95ea96
     api.Command.dns_update_system_records()
95ea96
+    ca_servers = service.find_providing_servers('CA', api.Backend.ldap2, api)
95ea96
     api.Backend.ldap2.disconnect()
95ea96
 
95ea96
     # Everything installed properly, activate ipa service.
95ea96
diff --git a/ipaserver/install/service.py b/ipaserver/install/service.py
95ea96
index 0106379ea38e4a3fef8436256d6f315f524b8dee..39dc49e872c82961defc09c7240604bc1cba2228 100644
95ea96
--- a/ipaserver/install/service.py
95ea96
+++ b/ipaserver/install/service.py
95ea96
@@ -64,7 +64,7 @@ SERVICE_LIST = {
95ea96
 }
95ea96
 
95ea96
 CONFIGURED_SERVICE = u'configuredService'
95ea96
-ENABLED_SERVICE = 'enabledService'
95ea96
+ENABLED_SERVICE = u'enabledService'
95ea96
 
95ea96
 
95ea96
 def print_msg(message, output_fd=sys.stdout):
95ea96
@@ -636,7 +636,7 @@ class Service(object):
95ea96
 
95ea96
         entry_dn = DN(('cn', name), ('cn', fqdn), ('cn', 'masters'),
95ea96
                         ('cn', 'ipa'), ('cn', 'etc'), ldap_suffix)
95ea96
-        search_kw = {'ipaConfigString': u'enabledService'}
95ea96
+        search_kw = {'ipaConfigString': ENABLED_SERVICE}
95ea96
         filter = api.Backend.ldap2.make_filter(search_kw)
95ea96
         try:
95ea96
             entries, _truncated = api.Backend.ldap2.find_entries(
95ea96
-- 
95ea96
2.17.1
95ea96