mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-11 00:31:56 -06:00
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>
This commit is contained in:
parent
f8b6595f49
commit
2f99140c92
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user