Server Upgrade: Handle connection better in updates_from_dict

Connection should be closed if update is done

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

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Martin Basti authored and Petr Vobornik committed 2015-04-14 19:25:47 +02:00
1 parent 0e752aab29
commit 4aec9d2280
1 file changed
+4 -3
+4 -3
View File
@@ -868,10 +868,11 @@ class LDAPUpdate:
updates is a dictionary containing the updates
"""
self.modified = False
if not self.conn:
try:
self.create_connection()
self._run_updates(updates)
self._run_updates(updates)
finally:
self.close_connection()
return self.modified