mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-24 22:27:41 -05:00
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:
1 parent
275e1482de
commit
61bdbd6e47
1 file changed
+7
@@ -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
|
||||
|
||||
Reference in new issue
Block a user