s4:domainlevel - handle exceptions more precisely
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 13 May 2010 20:35:06 +0000 (22:35 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 13 May 2010 20:42:22 +0000 (22:42 +0200)
LDB_ERR_UNWILLING_TO_PERFORM should be the right error code when the
"msDS-Behavior-Version" was already raised by the first change as it is on
Windows Server.

When s4 itself does implement this trigger then we don't need to do the
second write operation anymore (they're kept in sync).

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

index 310747a3dee2735be6b40871c024129110876ef6..72559bb924ea05e7de11da4696458a59b35f4b4c 100644 (file)
@@ -200,7 +200,7 @@ class cmd_domainlevel(Command):
                     try:
                         samdb.modify(m)
                     except LdbError, (num, _):
-                        pass
+                        self.assertEquals(num, ldb.ERR_UNWILLING_TO_PERFORM)
 
                 # Directly on the base DN
                 m = ldb.Message()
@@ -219,7 +219,7 @@ class cmd_domainlevel(Command):
                 try:
                     samdb.modify(m)
                 except LdbError, (num, _):
-                    pass
+                    self.assertEquals(num, ldb.ERR_UNWILLING_TO_PERFORM)
 
                 level_domain = new_level_domain
                 msgs.append("Domain function level changed!")