Fix upgrade: do not use invalid ldap connection

Ticket: https://fedorahosted.org/freeipa/ticket/4670
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Martin Basti
2014-11-06 10:45:16 +01:00
committed by Petr Vobornik
parent 9335552418
commit 730f33680b
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -889,3 +889,9 @@ class LDAPUpdate:
self._run_updates(updates)
return self.modified
def close_connection(self):
"""Close ldap connection"""
if self.conn:
self.conn.unbind()
self.conn = None
@@ -122,6 +122,9 @@ class updateclient(backend.Executioner):
for update in self.order(updatetype):
(restart, apply_now, res) = self.run(update.name, **kw)
if restart:
# connection has to be closed before restart, otherwise
# ld instance will try to reuse old non-valid connection
ld.close_connection()
self.restart(dm_password, live_run)
if apply_now: