s4.2/fsmo.py: fixed fsmo transfer exception
authorSteve Howells <steve.howells@moscowfirst.com>
Sat, 31 Jan 2015 16:09:17 +0000 (16:09 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 16 Mar 2015 02:00:06 +0000 (03:00 +0100)
In transfer_role() there is an duplicate call to samdb.modify() inside the if statement
where the type of role is being determined (specifically for the naming fsmo). This
call is unnecessary as after the if statement their is a correct call, with a try/catch
block, used by all fsmo transfers that will handle errors - such as the DC with the
fsmo role being offline.

The call to samdb.modify() inside the if statement for naming fsmo has been removed.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10924

Signed-off-by: Steve Howells <steve.howells@moscowfirst.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/fsmo.py

index 02721f97707896b3f6b6444040e29ed210f7db00..1bc4a960d9955fa777d0e573735f91a346b3d669 100644 (file)
@@ -50,7 +50,6 @@ def transfer_role(outf, role, samdb):
         m["becomeDomainMaster"]= ldb.MessageElement(
             "1", ldb.FLAG_MOD_REPLACE,
             "becomeDomainMaster")
         m["becomeDomainMaster"]= ldb.MessageElement(
             "1", ldb.FLAG_MOD_REPLACE,
             "becomeDomainMaster")
-        samdb.modify(m)
     elif role == "infrastructure":
         m["becomeInfrastructureMaster"]= ldb.MessageElement(
             "1", ldb.FLAG_MOD_REPLACE,
     elif role == "infrastructure":
         m["becomeInfrastructureMaster"]= ldb.MessageElement(
             "1", ldb.FLAG_MOD_REPLACE,