Commit 675e2bf5 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix master IP activation in failover with no-voting



Thanks to net.for.hub@gmail.com for reporting this. The logic in
masterd.CheckMasterd did an early return in case of no_voting, hence
skipping the master IP activation. We just change the ifs to not
return but simply continue through the function.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 6e7f0cd9
......@@ -578,26 +578,24 @@ def CheckMasterd(options, args):
# If CheckMaster didn't fail we believe we are the master, but we have to
# confirm with the other nodes.
if options.no_voting:
if options.yes_do_it:
return
if not options.yes_do_it:
sys.stdout.write("The 'no voting' option has been selected.\n")
sys.stdout.write("This is dangerous, please confirm by"
" typing uppercase 'yes': ")
sys.stdout.flush()
sys.stdout.write("The 'no voting' option has been selected.\n")
sys.stdout.write("This is dangerous, please confirm by"
" typing uppercase 'yes': ")
sys.stdout.flush()
confirmation = sys.stdin.readline().strip()
if confirmation != "YES":
print >> sys.stderr, "Aborting."
sys.exit(constants.EXIT_FAILURE)
confirmation = sys.stdin.readline().strip()
if confirmation != "YES":
print >> sys.stderr, "Aborting."
else:
# CheckAgreement uses RPC and threads, hence it needs to be run in
# a separate process before we call utils.Daemonize in the current
# process.
if not utils.RunInSeparateProcess(CheckAgreement):
sys.exit(constants.EXIT_FAILURE)
return
# CheckAgreement uses RPC and threads, hence it needs to be run in a separate
# process before we call utils.Daemonize in the current process.
if not utils.RunInSeparateProcess(CheckAgreement):
sys.exit(constants.EXIT_FAILURE)
# ActivateMasterIP also uses RPC/threads, so we run it again via a
# separate process.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment