samba-tool: nicer error in passwordsettings with no settings
authorAndrew Tridgell <tridge@samba.org>
Tue, 19 Jul 2011 01:39:52 +0000 (11:39 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 21 Jul 2011 01:44:32 +0000 (11:44 +1000)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/scripting/python/samba/netcmd/domain.py

index 9085d8b56ee7c31e52b154bd09c86be94c0f8090..680cfe9d10b316adf47c561a8f775dccc83f18d4 100644 (file)
@@ -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))