1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

python-samba-tool fsmo: Do not give an error on a successful role transfer

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Sep 23 12:00:24 CEST 2013 on sn-devel-104
This commit is contained in:
Andrew Bartlett 2013-05-09 15:16:55 +12:00 committed by Stefan Metzmacher
parent abb47b6ef8
commit 8d8872ae0a

View File

@ -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):