pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0015-Fix-CA-topology-warning.patch

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