mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipatests: fix for change_principal context manager
The context manager was leaving API object disconnected when an exception was raised inside of it. This led to resource leak in the tests. https://fedorahosted.org/freeipa/ticket/5733 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
committed by
Martin Basti
parent
90ca7d4167
commit
c4fa656b0e
@@ -696,6 +696,7 @@ def change_principal(user, password, client=None, path=None):
|
||||
|
||||
client.Backend.rpcclient.disconnect()
|
||||
|
||||
try:
|
||||
with private_ccache(ccache_name):
|
||||
kinit_password(user, password, ccache_name)
|
||||
client.Backend.rpcclient.connect()
|
||||
@@ -704,7 +705,7 @@ def change_principal(user, password, client=None, path=None):
|
||||
yield
|
||||
finally:
|
||||
client.Backend.rpcclient.disconnect()
|
||||
|
||||
finally:
|
||||
client.Backend.rpcclient.connect()
|
||||
|
||||
def get_group_dn(cn):
|
||||
|
||||
Reference in New Issue
Block a user