From 4fa74266285d637d6ccb88b1c7b7a217732b6e45 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 30 May 2014 15:38:04 +0200 Subject: [PATCH] Provide options no-voting and yes-do-it As the job handling is now done by luxid, that daemon is also in charge of verifying that it runs on the master node. So provide these options in the Haskell world as well. Signed-off-by: Klaus Aehlig Reviewed-by: Petr Pudlak --- src/Ganeti/Daemon.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Ganeti/Daemon.hs b/src/Ganeti/Daemon.hs index 8aeab028d..71ea260ce 100644 --- a/src/Ganeti/Daemon.hs +++ b/src/Ganeti/Daemon.hs @@ -39,6 +39,8 @@ module Ganeti.Daemon , oBindAddress , oSyslogUsage , oForceNode + , oNoVoting + , oYesDoIt , parseArgs , parseAddress , cleanupSocket @@ -102,6 +104,8 @@ data DaemonOptions = DaemonOptions , optBindAddress :: Maybe String -- ^ Override for the bind address , optSyslogUsage :: Maybe SyslogUsage -- ^ Override for Syslog usage , optForceNode :: Bool -- ^ Ignore node checks + , optNoVoting :: Bool -- ^ skip voting for master + , optYesDoIt :: Bool -- ^ force dangerous options } -- | Default values for the command line options. @@ -117,6 +121,8 @@ defaultOptions = DaemonOptions , optBindAddress = Nothing , optSyslogUsage = Nothing , optForceNode = False + , optNoVoting = False + , optYesDoIt = False } instance StandardOptions DaemonOptions where @@ -196,6 +202,20 @@ oForceNode = "Force the daemon to run on a different node than the master", OptComplNone) +oNoVoting :: OptType +oNoVoting = + (Option "" ["no-voting"] + (NoArg (\ opts -> Ok opts { optNoVoting = True })) + "Skip node agreement check (dangerous)", + OptComplNone) + +oYesDoIt :: OptType +oYesDoIt = + (Option "" ["yes-do-it"] + (NoArg (\ opts -> Ok opts { optYesDoIt = True })) + "Force a dangerous operation", + OptComplNone) + -- | Generic options. genericOpts :: [OptType] genericOpts = [ oShowHelp -- GitLab