Commit 5e96d216 authored by Guido Trotter's avatar Guido Trotter
Browse files

ganeti-masterd: allow non-interactive --no-voting



This will be used by ganeti-noded to start ganeti-masterd in a
--no-voting masterfailover.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 1dc10972
......@@ -396,6 +396,10 @@ def ParseOptions():
help="Do not check that the nodes agree on this node"
" being the master and start the daemon unconditionally",
default=False, action="store_true")
parser.add_option("--yes-do-it", dest="yes_do_it",
help="Override interactive check for --no-voting",
default=False, action="store_true")
options, args = parser.parse_args()
return options, args
......@@ -472,7 +476,7 @@ def main():
ssconf.CheckMaster(options.debug)
# we believe we are the master, let's ask the other nodes...
if options.no_voting:
if options.no_voting and 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': ")
......@@ -481,7 +485,7 @@ def main():
if confirmation != "YES":
print "Aborting."
return
else:
elif not options.no_voting:
if not CheckAgreement():
return
......
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