diff options
author | Petr Viktorin <pviktori@redhat.com> | 2014-07-04 09:50:58 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2014-07-04 15:51:55 +0200 |
commit | 2f99140c92f05c9ff11ff57002cb87784c632091 (patch) | |
tree | ffc755f7580698a91b65861f778b9018a931f9b8 | |
parent | f8b6595f4999740a704bcdae6d4f9b5021f7f61f (diff) | |
download | freeipa-2f99140c92f05c9ff11ff57002cb87784c632091.tar.gz freeipa-2f99140c92f05c9ff11ff57002cb87784c632091.tar.xz freeipa-2f99140c92f05c9ff11ff57002cb87784c632091.zip |
ldapupdate: Restore 'replace' functionality
The replace directive was made a no-op by mistake in commit 6381d76.
Restore it.
Reviewed-By: Martin Kosek <mkosek@redhat.com>
-rw-r--r-- | ipaserver/install/ldapupdate.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py index b6c6d2b90..6bed046d2 100644 --- a/ipaserver/install/ldapupdate.py +++ b/ipaserver/install/ldapupdate.py @@ -625,6 +625,14 @@ class LDAPUpdate: (old, new) = update_value.split('::', 1) except ValueError: raise BadSyntax, "bad syntax in replace, needs to be in the format old::new in %s" % update_value + try: + entry_values.remove(old) + except ValueError: + self.debug('replace: %s not found, skipping', safe_output(attr, old)) + else: + entry_values.append(new) + self.debug('replace: updated value %s', safe_output(attr, entry_values)) + entry[attr] = entry_values return entry |