Commit 5de4474d authored by Iustin Pop's avatar Iustin Pop

master daemon: allow skipping the voting process

This patch introduces a 'force' mode for the master daemon startup where
the voting process is not done, but the user has to confirm manually the
startup (before forking, of course).

Reviewed-by: imsnah
parent 7e6411e3
......@@ -367,6 +367,10 @@ def ParseOptions():
parser.add_option("-d", "--debug", dest="debug",
help="Enable some debug messages",
default=False, action="store_true")
parser.add_option("--no-voting", dest="no_voting",
help="Do not check that the nodes agree on this node"
" being the master and start the daemon unconditionally",
default=False, action="store_true")
options, args = parser.parse_args()
return options, args
......@@ -443,8 +447,18 @@ def main():
ssconf.CheckMaster(options.debug)
# we believe we are the master, let's ask the other nodes...
if not CheckAgreement():
return
if options.no_voting:
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 "Aborting."
return
else:
if not CheckAgreement():
return
dirs = [(constants.RUN_GANETI_DIR, constants.RUN_DIRS_MODE),
(constants.SOCKET_DIR, constants.SOCKET_DIR_MODE),
......
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