diff options
author | Rob Crittenden <rcritten@redhat.com> | 2008-10-15 09:58:29 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2008-10-15 09:58:29 -0400 |
commit | 789a248daa71d5d1377e0dc9f0cd3afe107d4f2a (patch) | |
tree | 9aeb50be721ff8187326f4cb8b620ef4dd9d9d9b /ipa_server/plugins | |
parent | e7937f294445d53396f7fb87d52eb4d4c9b97110 (diff) | |
download | freeipa-789a248daa71d5d1377e0dc9f0cd3afe107d4f2a.tar.gz freeipa-789a248daa71d5d1377e0dc9f0cd3afe107d4f2a.tar.xz freeipa-789a248daa71d5d1377e0dc9f0cd3afe107d4f2a.zip |
Port user-mod to use ldap update() method
Diffstat (limited to 'ipa_server/plugins')
-rw-r--r-- | ipa_server/plugins/b_ldap.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ipa_server/plugins/b_ldap.py b/ipa_server/plugins/b_ldap.py index 84f25245b..26a3495c3 100644 --- a/ipa_server/plugins/b_ldap.py +++ b/ipa_server/plugins/b_ldap.py @@ -48,8 +48,7 @@ class ldap(CrudBackend): self.api.env.basedn, ) - def find_entry_dn(self, key_attribute, primary_key, attributes=None, - object_type=None): + def find_entry_dn(self, key_attribute, primary_key, object_type=None): """ Find an existing entry's dn from an attribute """ @@ -73,7 +72,7 @@ class ldap(CrudBackend): search_base = "%s, %s" % (self.api.env.container_accounts, self.api.env.basedn) - entry = servercore.get_sub_entry(search_base, filter, attributes) + entry = servercore.get_sub_entry(search_base, filter, ['dn', 'objectclass']) return entry['dn'] @@ -95,6 +94,16 @@ class ldap(CrudBackend): def retrieve(self, dn, attributes=None): return servercore.get_entry_by_dn(dn, attributes) + def update(self, dn, **kw): + result = self.retrieve(dn, ["*"]) + + entry = ipaldap.Entry((dn, servercore.convert_scalar_values(result))) + + for k in kw: + entry.setValues(k, kw[k]) + + return servercore.update_entry(entry.toDict()) + def delete(self, dn): return servercore.delete_entry(dn) |