1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

pydsdb: Also accept ldb.MessageElement values to dsdb routines

This shows the correct way to accept a value that may be a list of strings
or a proper ldb.MessageElement.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
This commit is contained in:
Andrew Bartlett
2015-09-22 15:25:30 +12:00
parent 87cd68c1dc
commit b48776d78b
2 changed files with 67 additions and 58 deletions

View File

@ -1286,8 +1286,8 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
continue
if str(attrname).lower() == 'objectclass':
normalised = self.samdb.dsdb_normalise_attributes(self.samdb_schema, attrname, list(obj[attrname]))
if list(normalised) != list(obj[attrname]):
normalised = self.samdb.dsdb_normalise_attributes(self.samdb_schema, attrname, obj[attrname])
if normalised != obj[attrname]:
self.err_normalise_mismatch_replace(dn, attrname, list(obj[attrname]))
error_count += 1
continue