From 8608eaef76631666a41109317d2a9b20979c5025 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Fri, 14 May 2010 18:59:36 +0200 Subject: s4:net domainlevel tool - fix up the error handling as Jelmer suggested Sorry, I've copied this from the "ldap.py" test and thought it would work. --- source4/scripting/python/samba/netcmd/domainlevel.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source4/scripting/python/samba/netcmd/domainlevel.py b/source4/scripting/python/samba/netcmd/domainlevel.py index 72559bb924..4278ae5e4a 100644 --- a/source4/scripting/python/samba/netcmd/domainlevel.py +++ b/source4/scripting/python/samba/netcmd/domainlevel.py @@ -200,7 +200,8 @@ class cmd_domainlevel(Command): try: samdb.modify(m) except LdbError, (num, _): - self.assertEquals(num, ldb.ERR_UNWILLING_TO_PERFORM) + if num != ldb.ERR_UNWILLING_TO_PERFORM: + raise # Directly on the base DN m = ldb.Message() @@ -219,7 +220,8 @@ class cmd_domainlevel(Command): try: samdb.modify(m) except LdbError, (num, _): - self.assertEquals(num, ldb.ERR_UNWILLING_TO_PERFORM) + if num != ldb.ERR_UNWILLING_TO_PERFORM: + raise level_domain = new_level_domain msgs.append("Domain function level changed!") -- cgit