From acad20714833c22efbd4f0ae6d6bb3ea449bc314 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 9 May 2013 15:16:55 +1200 Subject: [PATCH] python-samba-tool fsmo: Do not give an error on a successful role transfer --- python/samba/netcmd/fsmo.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/samba/netcmd/fsmo.py b/python/samba/netcmd/fsmo.py index c938c91..02721f9 100644 --- a/python/samba/netcmd/fsmo.py +++ b/python/samba/netcmd/fsmo.py @@ -124,22 +124,22 @@ all=all of the above"""), self.message("Attempting transfer...") try: transfer_role(self.outf, role, samdb) + self.outf.write("FSMO seize was not required, as transfer of '%s' role was successful\n" % role) + return except CommandError: #transfer failed, use the big axe... self.message("Transfer unsuccessful, seizing...") - m["fSMORoleOwner"]= ldb.MessageElement( - serviceName, ldb.FLAG_MOD_REPLACE, - "fSMORoleOwner") else: self.message("Will not attempt transfer, seizing...") - m["fSMORoleOwner"]= ldb.MessageElement( - serviceName, ldb.FLAG_MOD_REPLACE, - "fSMORoleOwner") + + m["fSMORoleOwner"]= ldb.MessageElement( + serviceName, ldb.FLAG_MOD_REPLACE, + "fSMORoleOwner") try: samdb.modify(m) except LdbError, (num, msg): raise CommandError("Failed to initiate role seize of '%s' role: %s" % (role, msg)) - self.outf.write("FSMO transfer of '%s' role successful\n" % role) + self.outf.write("FSMO seize of '%s' role successful\n" % role) def run(self, force=None, H=None, role=None, credopts=None, sambaopts=None, versionopts=None): -- 1.7.11.7