Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -396,6 +396,10 @@ def ParseOptions(): ...@@ -396,6 +396,10 @@ def ParseOptions():
help="Do not check that the nodes agree on this node" help="Do not check that the nodes agree on this node"
" being the master and start the daemon unconditionally", " being the master and start the daemon unconditionally",
default=False, action="store_true") 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() options, args = parser.parse_args()
return options, args return options, args
...@@ -472,7 +476,7 @@ def main(): ...@@ -472,7 +476,7 @@ def main():
ssconf.CheckMaster(options.debug) ssconf.CheckMaster(options.debug)
# we believe we are the master, let's ask the other nodes... # 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("The 'no voting' option has been selected.\n")
sys.stdout.write("This is dangerous, please confirm by" sys.stdout.write("This is dangerous, please confirm by"
" typing uppercase 'yes': ") " typing uppercase 'yes': ")
...@@ -481,7 +485,7 @@ def main(): ...@@ -481,7 +485,7 @@ def main():
if confirmation != "YES": if confirmation != "YES":
print "Aborting." print "Aborting."
return return
else: elif not options.no_voting:
if not CheckAgreement(): if not CheckAgreement():
return return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment