979ee0
From 699104cf8b8d0ec2570b3801e86c6a358343527a Mon Sep 17 00:00:00 2001
979ee0
From: Christian Heimes <cheimes@redhat.com>
979ee0
Date: Fri, 29 Jun 2018 11:08:45 +0200
979ee0
Subject: [PATCH] Catch ACIError instead of invalid credentials
979ee0
979ee0
ipaldap's LDAPClient client turns INVALID_CREDENTIAL error into
979ee0
ACIError. Catch the ACIError and wait until the user has been
979ee0
replicated.
979ee0
979ee0
Apparently no manual or automated test ran into the timeout during
979ee0
testing.
979ee0
979ee0
Fixes: Fixes: https://pagure.io/freeipa/issue/7593
979ee0
Signed-off-by: Christian Heimes <cheimes@redhat.com>
979ee0
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
979ee0
---
979ee0
 ipaserver/install/dogtaginstance.py | 3 ++-
979ee0
 1 file changed, 2 insertions(+), 1 deletion(-)
979ee0
979ee0
diff --git a/ipaserver/install/dogtaginstance.py b/ipaserver/install/dogtaginstance.py
979ee0
index 960b8cc7ce495bf5ca359f72b46aa0d43ccec5c3..1f9742b287f58ed117aba627ad85ac3ced4b2645 100644
979ee0
--- a/ipaserver/install/dogtaginstance.py
979ee0
+++ b/ipaserver/install/dogtaginstance.py
979ee0
@@ -468,7 +468,8 @@ class DogtagInstance(service.Service):
979ee0
             time.sleep(1)
979ee0
             try:
979ee0
                 master_conn.simple_bind(self.admin_dn, self.admin_password)
979ee0
-            except ldap.INVALID_CREDENTIALS:
979ee0
+            except errors.ACIError:
979ee0
+                # user not replicated yet
979ee0
                 pass
979ee0
             else:
979ee0
                 self.log.debug("Successfully logged in as %s", self.admin_dn)
979ee0
-- 
979ee0
2.17.1
979ee0