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:
1 parent
9335552418
commit
730f33680b
2 files changed
+9
No files matched your search
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user