def move(self, dn, newdn): newrdn = get_rdn (newdn) parent1 = get_parent_dn (dn) parent2 = get_parent_dn (newdn) if parent1 != parent2: self.lo.rename_s(s4.compatible_modstring (unicode (dn)), s4.compatible_modstring (unicode (newrdn)), s4.compatible_modstring (unicode (parent2))) else: self.lo.modrdn_s(s4.compatible_modstring (unicode (dn)), s4.compatible_modstring (unicode (newrdn)))
def delete(self, dn): self.lo.delete_s(s4.compatible_modstring (unicode (dn)))
def create(self, dn, attrs): ldif = modlist.addModlist(attrs) self.lo.add_s(s4.compatible_modstring (unicode (dn)),ldif)
def remove_from_attribute(self, dn, key, value): self.lo.modify_s (s4.compatible_modstring (unicode (dn)), [(ldap.MOD_DELETE, key, s4.compatible_modstring (unicode (value)))])
def append_to_attribute(self, dn, key, value): self.lo.modify_s (s4.compatible_modstring (unicode (dn)), [(ldap.MOD_ADD, key, s4.compatible_modstring (unicode (value)))])
def delete_attribute(self, dn, key): self.lo.modify_s (s4.compatible_modstring (unicode (dn)), [(ldap.MOD_DELETE, key, None)])
def set_attribute(self, dn, key, value): self.lo.modify_s (s4.compatible_modstring (unicode (dn)), [(ldap.MOD_REPLACE, key, s4.compatible_modstring (unicode (value)))])