From 4aec9d2280a5ebbf1acae3abee215cd7a28f23c2 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Mon, 23 Mar 2015 12:33:30 +0100 Subject: [PATCH] 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 --- ipaserver/install/ldapupdate.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py index 4bb260b33..6d1c589ec 100644 --- a/ipaserver/install/ldapupdate.py +++ b/ipaserver/install/ldapupdate.py @@ -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