diff options
author | Martin Basti <mbasti@redhat.com> | 2014-11-04 15:59:50 +0100 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-11-06 10:45:16 +0100 |
commit | 730f33680b7254622659eec2e48399ef7033a477 (patch) | |
tree | f193d6df1ff4b3a340aa6da135112c168b59dd1d /ipaserver | |
parent | 9335552418e515cd97da549da403447e5cae842c (diff) | |
download | freeipa-730f33680b7254622659eec2e48399ef7033a477.tar.gz freeipa-730f33680b7254622659eec2e48399ef7033a477.tar.xz freeipa-730f33680b7254622659eec2e48399ef7033a477.zip |
Fix upgrade: do not use invalid ldap connection
Ticket: https://fedorahosted.org/freeipa/ticket/4670
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
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: |