Use "None"-changetype here, instead of "Add". This avoids the need to
remove the changetype line afterwards.
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
raise CommandError('Unable to find user "%s"' % (username))
for msg in res:
- r_ldif = samdb.write_ldif(msg, 1)
- # remove 'changetype' line
- result_ldif = re.sub('changetype: add\n', '', r_ldif)
+ result_ldif = samdb.write_ldif(msg, ldb.CHANGETYPE_NONE)
if editor is None:
editor = os.environ.get('EDITOR')