diff options
author | Martin Basti <[email protected]> | 2014-11-04 15:59:50 +0100 |
---|---|---|
committer | Petr Vobornik <[email protected]> | 2014-11-06 10:45:16 +0100 |
commit | 5d65a2a3058aadff29e9af2a6fd3aab91607674f (patch) | |
tree | 5c8adfa860d03f06cefbb6ca78ed7d5b09b9e32a /ipaserver | |
parent | 25abb1154b7b9b6164612f624143bc583e896b12 (diff) | |
download | freeipa-5d65a2a3058aadff29e9af2a6fd3aab91607674f.tar.gz freeipa-5d65a2a3058aadff29e9af2a6fd3aab91607674f.tar.xz freeipa-5d65a2a3058aadff29e9af2a6fd3aab91607674f.zip |
Fix upgrade: do not use invalid ldap connection
Ticket: https://fedorahosted.org/freeipa/ticket/4670
Reviewed-By: Jan Cholasta <[email protected]>
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/install/ldapupdate.py | 6 | ||||
-rw-r--r-- | ipaserver/install/plugins/updateclient.py | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py index 6bed046d2..47f0399b9 100644 --- a/ipaserver/install/ldapupdate.py +++ b/ipaserver/install/ldapupdate.py @@ -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 diff --git a/ipaserver/install/plugins/updateclient.py b/ipaserver/install/plugins/updateclient.py index 7566b6cd8..8f5c5b5fd 100644 --- a/ipaserver/install/plugins/updateclient.py +++ b/ipaserver/install/plugins/updateclient.py @@ -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: |