upgrade: make sure ldap2 is connected in export_kra_agent_pem

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

Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
This commit is contained in:
Jan Cholasta committed 2015-10-12 15:51:14 +02:00
1 parent 275e1482de
commit 61bdbd6e47
1 file changed
+7
+7
View File
@@ -1258,6 +1258,13 @@ def export_kra_agent_pem():
root_logger.info("KRA agent PEM file already exported")
return
if not api.Backend.ldap2.isconnected():
try:
api.Backend.ldap2.connect(autobind=True)
except ipalib.errors.PublicError as e:
root_logger.error("Cannot connect to LDAP: %s", e)
return
if not api.Command.kra_is_enabled()['result']:
root_logger.info("KRA is not enabled")
return