Commit 4fa74266 authored by Klaus Aehlig's avatar Klaus Aehlig

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: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 38acc50f
...@@ -39,6 +39,8 @@ module Ganeti.Daemon ...@@ -39,6 +39,8 @@ module Ganeti.Daemon
, oBindAddress , oBindAddress
, oSyslogUsage , oSyslogUsage
, oForceNode , oForceNode
, oNoVoting
, oYesDoIt
, parseArgs , parseArgs
, parseAddress , parseAddress
, cleanupSocket , cleanupSocket
...@@ -102,6 +104,8 @@ data DaemonOptions = DaemonOptions ...@@ -102,6 +104,8 @@ data DaemonOptions = DaemonOptions
, optBindAddress :: Maybe String -- ^ Override for the bind address , optBindAddress :: Maybe String -- ^ Override for the bind address
, optSyslogUsage :: Maybe SyslogUsage -- ^ Override for Syslog usage , optSyslogUsage :: Maybe SyslogUsage -- ^ Override for Syslog usage
, optForceNode :: Bool -- ^ Ignore node checks , optForceNode :: Bool -- ^ Ignore node checks
, optNoVoting :: Bool -- ^ skip voting for master
, optYesDoIt :: Bool -- ^ force dangerous options
} }
-- | Default values for the command line options. -- | Default values for the command line options.
...@@ -117,6 +121,8 @@ defaultOptions = DaemonOptions ...@@ -117,6 +121,8 @@ defaultOptions = DaemonOptions
, optBindAddress = Nothing , optBindAddress = Nothing
, optSyslogUsage = Nothing , optSyslogUsage = Nothing
, optForceNode = False , optForceNode = False
, optNoVoting = False
, optYesDoIt = False
} }
instance StandardOptions DaemonOptions where instance StandardOptions DaemonOptions where
...@@ -196,6 +202,20 @@ oForceNode = ...@@ -196,6 +202,20 @@ oForceNode =
"Force the daemon to run on a different node than the master", "Force the daemon to run on a different node than the master",
OptComplNone) 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. -- | Generic options.
genericOpts :: [OptType] genericOpts :: [OptType]
genericOpts = [ oShowHelp genericOpts = [ oShowHelp
......
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