Hs2Py constants: 'jobIdsKey', 'runparts' and 'rpc'
authorJose A. Lopes <jabolopes@google.com>
Fri, 4 Oct 2013 16:08:36 +0000 (18:08 +0200)
committerJose A. Lopes <jabolopes@google.com>
Tue, 8 Oct 2013 12:57:28 +0000 (14:57 +0200)
Add several groups of constants to the Haskell to Python constant generation.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

lib/constants.py
src/Ganeti/HsConstants.hs

index 3a250ff..9f5d969 100644 (file)
@@ -445,6 +445,15 @@ NODE_MAX_CLOCK_SKEW = _constants.NODE_MAX_CLOCK_SKEW
 DISK_TRANSFER_CONNECT_TIMEOUT = _constants.DISK_TRANSFER_CONNECT_TIMEOUT
 DISK_SEPARATOR = _constants.DISK_SEPARATOR
 IP_COMMAND_PATH = _constants.IP_COMMAND_PATH
+JOB_IDS_KEY = _constants.JOB_IDS_KEY
+
+RUNPARTS_SKIP = _constants.RUNPARTS_SKIP
+RUNPARTS_RUN = _constants.RUNPARTS_RUN
+RUNPARTS_ERR = _constants.RUNPARTS_ERR
+RUNPARTS_STATUS = _constants.RUNPARTS_STATUS
+
+RPC_ENCODING_NONE = _constants.RPC_ENCODING_NONE
+RPC_ENCODING_ZLIB_BASE64 = _constants.RPC_ENCODING_ZLIB_BASE64
 
 RPC_TMO_URGENT = _constants.RPC_TMO_URGENT
 RPC_TMO_FAST = _constants.RPC_TMO_FAST
@@ -454,24 +463,6 @@ RPC_TMO_4HRS = _constants.RPC_TMO_4HRS
 RPC_TMO_1DAY = _constants.RPC_TMO_1DAY
 RPC_CONNECT_TIMEOUT = _constants.RPC_CONNECT_TIMEOUT
 
-#: Key for job IDs in opcode result
-JOB_IDS_KEY = "jobs"
-
-# runparts results
-(RUNPARTS_SKIP,
- RUNPARTS_RUN,
- RUNPARTS_ERR) = range(3)
-
-RUNPARTS_STATUS = compat.UniqueFrozenset([
-  RUNPARTS_SKIP,
-  RUNPARTS_RUN,
-  RUNPARTS_ERR,
-  ])
-
-# RPC constants
-(RPC_ENCODING_NONE,
- RPC_ENCODING_ZLIB_BASE64) = range(2)
-
 # os related constants
 OS_SCRIPT_CREATE = "create"
 OS_SCRIPT_IMPORT = "import"
index 73bcecc..ca790d2 100644 (file)
@@ -1139,6 +1139,32 @@ diskTransferConnectTimeout = 60
 diskSeparator :: String
 diskSeparator = AutoConf.diskSeparator
 
+-- | Key for job IDs in opcode result
+jobIdsKey :: String
+jobIdsKey = "jobs"
+
+-- * Runparts results
+
+runpartsErr :: Int
+runpartsErr = 2
+
+runpartsRun :: Int
+runpartsRun = 1
+
+runpartsSkip :: Int
+runpartsSkip = 0
+
+runpartsStatus :: [Int]
+runpartsStatus = [runpartsErr, runpartsRun, runpartsSkip]
+
+-- * RPC
+
+rpcEncodingNone :: Int
+rpcEncodingNone = 0
+
+rpcEncodingZlibBase64 :: Int
+rpcEncodingZlibBase64 = 1
+
 -- * Timeout table
 --
 -- Various time constants for the timeout table