diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-06-01 14:41:51 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-06-01 17:24:36 +1000 |
commit | 7b3d8b6c908a37bb06e413dee406cebd29b99b3e (patch) | |
tree | b21e9adfc65bb8b0dbbf94d61c3057887ebdf077 /source4/scripting/python/samba/samdb.py | |
parent | 23177b5f44815bc5b46943c70d37dc626ed60288 (diff) | |
download | samba-7b3d8b6c908a37bb06e413dee406cebd29b99b3e.tar.gz samba-7b3d8b6c908a37bb06e413dee406cebd29b99b3e.tar.bz2 samba-7b3d8b6c908a37bb06e413dee406cebd29b99b3e.zip |
samba-tool: improved user enable error handling
Diffstat (limited to 'source4/scripting/python/samba/samdb.py')
-rw-r--r-- | source4/scripting/python/samba/samdb.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py index 99f141e664..2cea198e6b 100644 --- a/source4/scripting/python/samba/samdb.py +++ b/source4/scripting/python/samba/samdb.py @@ -79,6 +79,8 @@ class SamDB(samba.Ldb): """ res = self.search(base=self.domain_dn(), scope=ldb.SCOPE_SUBTREE, expression=search_filter, attrs=["userAccountControl"]) + if len(res) == 0: + raise Exception('Unable to find user "%s"' % search_filter) assert(len(res) == 1) user_dn = res[0].dn |