From a8cba72119987803a806c3e05f3b5ac3c1be755d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 19 Jul 2011 11:39:52 +1000 Subject: samba-tool: nicer error in passwordsettings with no settings Pair-Programmed-With: Andrew Bartlett --- source4/scripting/python/samba/netcmd/domain.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/scripting') diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py index 9085d8b56e..680cfe9d10 100644 --- a/source4/scripting/python/samba/netcmd/domain.py +++ b/source4/scripting/python/samba/netcmd/domain.py @@ -479,6 +479,8 @@ class cmd_domain_passwordsettings(Command): if max_pwd_age > 0 and min_pwd_age >= max_pwd_age: raise CommandError("Maximum password age (%d) must be greater than minimum password age (%d)!" % (max_pwd_age, min_pwd_age)) + if len(m) == 0: + raise CommandError("You must specify at least one option to set. Try --help") samdb.modify(m) msgs.append("All changes applied successfully!") self.message("\n".join(msgs)) -- cgit