pgreco / rpms / ipa

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

Blame SOURCES/0155-Wait-until-HTTPS-principal-entry-is-replicated-to-re.patch

ff14fa
From ea3848ae6729fda734ec60167129f4cae5253a44 Mon Sep 17 00:00:00 2001
ff14fa
From: Martin Basti <mbasti@redhat.com>
ff14fa
Date: Wed, 18 Jan 2017 13:56:24 +0100
ff14fa
Subject: [PATCH] Wait until HTTPS principal entry is replicated to replica
ff14fa
ff14fa
Without HTTP principal the steps later fails.
ff14fa
ff14fa
https://fedorahosted.org/freeipa/ticket/6588
ff14fa
ff14fa
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
ff14fa
---
ff14fa
 ipaserver/install/server/replicainstall.py | 10 +++++++++-
ff14fa
 1 file changed, 9 insertions(+), 1 deletion(-)
ff14fa
ff14fa
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
ff14fa
index f54ff7da06c57b9c8251429cbdacc5c300805f84..2a1c290351d8ce1dade5eea2f67539659555af2e 100644
ff14fa
--- a/ipaserver/install/server/replicainstall.py
ff14fa
+++ b/ipaserver/install/server/replicainstall.py
ff14fa
@@ -36,7 +36,7 @@ from ipaserver.install import (
ff14fa
 from ipaserver.install.installutils import (
ff14fa
     create_replica_config, ReplicaConfig, load_pkcs12, is_ipa_configured)
ff14fa
 from ipaserver.install.replication import (
ff14fa
-    ReplicationManager, replica_conn_check)
ff14fa
+    ReplicationManager, replica_conn_check, wait_for_entry)
ff14fa
 import SSSDConfig
ff14fa
 from subprocess import CalledProcessError
ff14fa
 from binascii import hexlify
ff14fa
@@ -86,6 +86,14 @@ def install_http_certs(config, fstore, remote_api):
ff14fa
                                         config.master_host_name,
ff14fa
                                         paths.IPA_KEYTAB,
ff14fa
                                         force_service_add=True)
ff14fa
+    dn = DN(
ff14fa
+        ('krbprincipalname', principal),
ff14fa
+        api.env.container_service, api.env.basedn
ff14fa
+    )
ff14fa
+    conn = ipaldap.IPAdmin(realm=config.realm_name, ldapi=True)
ff14fa
+    conn.do_external_bind()
ff14fa
+    wait_for_entry(conn, dn)
ff14fa
+    conn.unbind()
ff14fa
 
ff14fa
     # Obtain certificate for the HTTP service
ff14fa
     nssdir = certs.NSS_DIR
ff14fa
-- 
ff14fa
2.9.3
ff14fa