@param no_voting: force the operation without remote nodes agreement
(dangerous)
+ @returns: the pair of an exit code and warnings to display
"""
sstore = ssconf.SimpleStore()
# end checks
rcode = 0
+ warnings = []
logging.info("Setting master to %s, old master: %s", new_master, old_master)
msg = result.fail_msg
if msg:
- logging.warning("Could not disable the master IP: %s", msg)
+ warning = "Could not disable the master IP: %s" % (msg,)
+ logging.warning("%s", warning)
+ warnings.append(warning)
result = runner.call_node_stop_master(old_master)
msg = result.fail_msg
if msg:
- logging.error("Could not disable the master role on the old master"
- " %s, please disable manually: %s", old_master, msg)
+ warning = ("Could not disable the master role on the old master"
+ " %s, please disable manually: %s" % (old_master, msg))
+ logging.error("%s", warning)
+ warnings.append(warning)
logging.info("Checking master IP non-reachability...")
try:
utils.Retry(_check_ip, (1, 1.5, 5), total_timeout)
except utils.RetryTimeout:
- logging.warning("The master IP is still reachable after %s seconds,"
- " continuing but activating the master on the current"
- " node will probably fail", total_timeout)
+ warning = ("The master IP is still reachable after %s seconds,"
+ " continuing but activating the master on the current"
+ " node will probably fail" % total_timeout)
+ logging.warning("%s", warning)
+ warnings.append(warning)
if jstore.CheckDrainFlag():
logging.info("Undraining job queue")
rcode = 1
logging.info("Master failed over from %s to %s", old_master, new_master)
- return rcode
+ return rcode, warnings
def GetMaster():