Commit 43a9e860 authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

Haskell to Python constants: add exit code constants



Add exit code constants to Haskell to Python constant generation
infrastructure.  The module 'Ganeti.ConstantUtils' must be imported
qualified in order to avoid a clash between
'Ganeti.ConstantUtils.exitFailure' and
'Ganeti.HsConstants.exitFailure'.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 1a79791d
......@@ -58,7 +58,7 @@ adminstUp :: String
adminstUp = "up"
adminstAll :: FrozenSet String
adminstAll = mkSet [adminstDown, adminstOffline, adminstUp]
adminstAll = ConstantUtils.mkSet [adminstDown, adminstOffline, adminstUp]
-- * User separation
......@@ -140,12 +140,12 @@ rapi = Runtime.daemonName GanetiRapi
daemons :: FrozenSet String
daemons =
mkSet [confd,
luxid,
masterd,
mond,
noded,
rapi]
ConstantUtils.mkSet [confd,
luxid,
masterd,
mond,
noded,
rapi]
defaultConfdPort :: Int
defaultConfdPort = 1814
......@@ -178,6 +178,31 @@ extraLogreasonAccess = Runtime.daemonsExtraLogbase GanetiMond AccessLog
extraLogreasonError :: String
extraLogreasonError = Runtime.daemonsExtraLogbase GanetiMond ErrorLog
-- * Common exit codes
exitSuccess :: Int
exitSuccess = 0
exitFailure :: Int
exitFailure = ConstantUtils.exitFailure
exitNotcluster :: Int
exitNotcluster = 5
exitNotmaster :: Int
exitNotmaster = 11
exitNodesetupError :: Int
exitNodesetupError = 12
-- | Need user confirmation
exitConfirmation :: Int
exitConfirmation = 13
-- | Exit code for query operations with unknown fields
exitUnknownField :: Int
exitUnknownField = 14
-- * Possible values for NodeGroup.alloc_policy
allocPolicyLastResort :: String
......@@ -232,10 +257,10 @@ autoRepairReinstall = "reinstall"
autoRepairAllTypes :: FrozenSet String
autoRepairAllTypes =
mkSet [autoRepairFailover,
autoRepairFixStorage,
autoRepairMigrate,
autoRepairReinstall]
ConstantUtils.mkSet [autoRepairFailover,
autoRepairFixStorage,
autoRepairMigrate,
autoRepairReinstall]
-- * Auto-repair results
......@@ -250,7 +275,7 @@ autoRepairSuccess = "success"
autoRepairAllResults :: FrozenSet String
autoRepairAllResults =
mkSet [autoRepairEnoperm, autoRepairFailure, autoRepairSuccess]
ConstantUtils.mkSet [autoRepairEnoperm, autoRepairFailure, autoRepairSuccess]
-- | The version identifier for builtin data collectors
builtinDataCollectorVersion :: String
......
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