summaryrefslogtreecommitdiff
path: root/python/samba
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2019-03-13 17:40:37 +0100
committerAndrew Bartlett <abartlet@samba.org>2019-07-04 02:07:20 +0000
commit4954118b81e96ef677b1965d06427d626855e73f (patch)
tree09a0b234276ed3f6d623e3bbffb6cccac93e7ed6 /python/samba
parent64e37e3822afbed2f5b97b8d456108cc79bd99bc (diff)
downloadsamba-4954118b81e96ef677b1965d06427d626855e73f.tar.gz
samba-tool user edit: simplify code
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>
Diffstat (limited to 'python/samba')
-rw-r--r--python/samba/netcmd/user.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/python/samba/netcmd/user.py b/python/samba/netcmd/user.py
index 28ff617f12b..112756ea4f5 100644
--- a/python/samba/netcmd/user.py
+++ b/python/samba/netcmd/user.py
@@ -2448,9 +2448,7 @@ LDAP server using the 'nano' editor.
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')