mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
do not disconnect when using existing connection to check default CA ACLs
https://fedorahosted.org/freeipa/ticket/5459 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
341406d165
commit
ed830af693
@ -2004,7 +2004,8 @@ def _create_dogtag_profile(profile_id, profile_data):
|
|||||||
|
|
||||||
def ensure_default_caacl():
|
def ensure_default_caacl():
|
||||||
"""Add the default CA ACL if missing."""
|
"""Add the default CA ACL if missing."""
|
||||||
if not api.Backend.ldap2.isconnected():
|
is_already_connected = api.Backend.ldap2.isconnected()
|
||||||
|
if not is_already_connected:
|
||||||
try:
|
try:
|
||||||
api.Backend.ldap2.connect(autobind=True)
|
api.Backend.ldap2.connect(autobind=True)
|
||||||
except errors.PublicError as e:
|
except errors.PublicError as e:
|
||||||
@ -2028,7 +2029,7 @@ def ensure_default_caacl():
|
|||||||
api.Command.caacl_add_profile(u'hosts_services_caIPAserviceCert',
|
api.Command.caacl_add_profile(u'hosts_services_caIPAserviceCert',
|
||||||
certprofile=(u'caIPAserviceCert',))
|
certprofile=(u'caIPAserviceCert',))
|
||||||
|
|
||||||
if api.Backend.ldap2.isconnected():
|
if not is_already_connected:
|
||||||
api.Backend.ldap2.disconnect()
|
api.Backend.ldap2.disconnect()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user