custodia: force reconnect before retrieving CA certs from LDAP

Force reconnect to LDAP as DS might have been restarted after the
connection was opened, rendering the connection invalid.

This fixes a crash in ipa-replica-install with --setup-ca.

https://fedorahosted.org/freeipa/ticket/6207

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Jan Cholasta
2016-09-01 13:11:09 +02:00
committed by Martin Basti
parent dd02741896
commit 17ea4ae6b9
+2
View File
@@ -158,6 +158,8 @@ class CustodiaInstance(SimpleServiceInstance):
# Add CA certificates
tmpdb = CertDB(self.realm, nssdir=tmpnssdir)
self.suffix = ipautil.realm_to_suffix(self.realm)
if self.admin_conn is not None:
self.ldap_disconnect()
self.import_ca_certs(tmpdb, True)
# Now that we gathered all certs, re-export