diff options
author | Martin Basti <mbasti@redhat.com> | 2015-05-25 14:57:04 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-05-26 11:33:07 +0000 |
commit | 9eedffdfa62b4fa64244f048969b45b27a995c7a (patch) | |
tree | a7be276482ebc5bb5bea4679bcff2c310eb013d5 /ipaserver | |
parent | f903c2d5bff3e420519f7bbf026b9bfcc5460fb0 (diff) | |
download | freeipa-9eedffdfa62b4fa64244f048969b45b27a995c7a.tar.gz freeipa-9eedffdfa62b4fa64244f048969b45b27a995c7a.tar.xz freeipa-9eedffdfa62b4fa64244f048969b45b27a995c7a.zip |
Server Upgrade: fix remove statement
If value does not exists then do not update entry. Otherwise, together with
nonexistent entry, the LDAP decode error will be raised.
https://fedorahosted.org/freeipa/ticket/4904
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/install/ldapupdate.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py index 2f5bcc748..5fca37695 100644 --- a/ipaserver/install/ldapupdate.py +++ b/ipaserver/install/ldapupdate.py @@ -648,9 +648,10 @@ class LDAPUpdate: entry_values.remove(update_value) except ValueError: self.warning("remove: '%s' not in %s", update_value, attr) - pass - entry[attr] = entry_values - self.debug('remove: updated value %s', safe_output(attr, entry_values)) + else: + entry[attr] = entry_values + self.debug('remove: updated value %s', safe_output( + attr, entry_values)) elif action == 'add': self.debug("add: '%s' to %s, current value %s", safe_output(attr, update_value), attr, safe_output(attr, entry_values)) # Remove it, ignoring errors so we can blindly add it later |