summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-29 16:57:25 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-29 18:04:42 +1100
commitdc0c89cf405e7cc1d66540c4f94b1b395da2439a (patch)
treec269da41417b2b4c47d243b7211d3b7821619663 /source4
parentc522cd73ac29c0bc2551e679284da71d46f533e1 (diff)
downloadsamba-dc0c89cf405e7cc1d66540c4f94b1b395da2439a.tar.gz
samba-dc0c89cf405e7cc1d66540c4f94b1b395da2439a.tar.bz2
samba-dc0c89cf405e7cc1d66540c4f94b1b395da2439a.zip
s4-samdb: give a better exception if multiple users match in password change
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/samdb.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index 67e77e303b..a7f474d134 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -372,7 +372,8 @@ member: %s
expression=search_filter, attrs=[])
if len(res) == 0:
raise Exception('Unable to find user "%s"' % (username or search_filter))
- assert(len(res) == 1)
+ if len(res) > 1:
+ raise Exception('Matched %u multiple users with filter "%s"' % (len(res), search_filter))
user_dn = res[0].dn
setpw = """
dn: %s