Hs2Py constants: hail, opcode, and SSH
authorJose A. Lopes <jabolopes@google.com>
Fri, 4 Oct 2013 17:43:11 +0000 (19:43 +0200)
committerJose A. Lopes <jabolopes@google.com>
Tue, 8 Oct 2013 12:57:31 +0000 (14:57 +0200)
Add hail, opcode, and SSH related 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 db20968..197a023 100644 (file)
@@ -1496,31 +1496,24 @@ BLOCKDEV_DRIVER_MANUAL = _constants.BLOCKDEV_DRIVER_MANUAL
 QEMUIMG_PATH = _constants.QEMUIMG_PATH
 
 HTOOLS = _constants.HTOOLS
-# The hail iallocator
-IALLOC_HAIL = "hail"
-
-# Fake opcodes for functions that have hooks attached to them via
-# backend.RunLocalHooks
-FAKE_OP_MASTER_TURNUP = "OP_CLUSTER_IP_TURNUP"
-FAKE_OP_MASTER_TURNDOWN = "OP_CLUSTER_IP_TURNDOWN"
-
-# SSH key types
-SSHK_RSA = "rsa"
-SSHK_DSA = "dsa"
-SSHK_ALL = compat.UniqueFrozenset([SSHK_RSA, SSHK_DSA])
-
-# SSH authorized key types
-SSHAK_RSA = "ssh-rsa"
-SSHAK_DSS = "ssh-dss"
-SSHAK_ALL = compat.UniqueFrozenset([SSHAK_RSA, SSHAK_DSS])
-
-# SSH setup
-SSHS_CLUSTER_NAME = "cluster_name"
-SSHS_SSH_HOST_KEY = "ssh_host_key"
-SSHS_SSH_ROOT_KEY = "ssh_root_key"
-SSHS_NODE_DAEMON_CERTIFICATE = "node_daemon_certificate"
-
-#: Key files for SSH daemon
+IALLOC_HAIL = _constants.IALLOC_HAIL
+
+FAKE_OP_MASTER_TURNUP = _constants.FAKE_OP_MASTER_TURNUP
+FAKE_OP_MASTER_TURNDOWN = _constants.FAKE_OP_MASTER_TURNDOWN
+
+SSHK_RSA = _constants.SSHK_RSA
+SSHK_DSA = _constants.SSHK_DSA
+SSHK_ALL = _constants.SSHK_ALL
+
+SSHAK_RSA = _constants.SSHAK_RSA
+SSHAK_DSS = _constants.SSHAK_DSS
+SSHAK_ALL = _constants.SSHAK_ALL
+
+SSHS_CLUSTER_NAME = _constants.SSHS_CLUSTER_NAME
+SSHS_SSH_HOST_KEY = _constants.SSHS_SSH_HOST_KEY
+SSHS_SSH_ROOT_KEY = _constants.SSHS_SSH_ROOT_KEY
+SSHS_NODE_DAEMON_CERTIFICATE = _constants.SSHS_NODE_DAEMON_CERTIFICATE
+
 SSH_DAEMON_KEYFILES = {
   SSHK_RSA: (pathutils.SSH_HOST_RSA_PRIV, pathutils.SSH_HOST_RSA_PUB),
   SSHK_DSA: (pathutils.SSH_HOST_DSA_PRIV, pathutils.SSH_HOST_DSA_PUB),
index 559d0a0..874867b 100644 (file)
@@ -3670,6 +3670,55 @@ qemuimgPath = AutoConf.qemuimgPath
 htools :: Bool
 htools = AutoConf.htools
 
+-- | The hail iallocator
+iallocHail :: String
+iallocHail = "hail"
+
+-- * Fake opcodes for functions that have hooks attached to them via
+-- backend.RunLocalHooks
+
+fakeOpMasterTurndown :: String
+fakeOpMasterTurndown = "OP_CLUSTER_IP_TURNDOWN"
+
+fakeOpMasterTurnup :: String
+fakeOpMasterTurnup = "OP_CLUSTER_IP_TURNUP"
+
+-- * SSH key types
+
+sshkDsa :: String
+sshkDsa = "dsa"
+
+sshkRsa :: String
+sshkRsa = "rsa"
+
+sshkAll :: FrozenSet String
+sshkAll = ConstantUtils.mkSet [sshkRsa, sshkDsa]
+
+-- * SSH authorized key types
+
+sshakDss :: String
+sshakDss = "ssh-dss"
+
+sshakRsa :: String
+sshakRsa = "ssh-rsa"
+
+sshakAll :: FrozenSet String
+sshakAll = ConstantUtils.mkSet [sshakDss, sshakRsa]
+
+-- * SSH setup
+
+sshsClusterName :: String
+sshsClusterName = "cluster_name"
+
+sshsSshHostKey :: String
+sshsSshHostKey = "ssh_host_key"
+
+sshsSshRootKey :: String
+sshsSshRootKey = "ssh_root_key"
+
+sshsNodeDaemonCertificate :: String
+sshsNodeDaemonCertificate = "node_daemon_certificate"
+
 -- * Key files for SSH daemon
 
 sshHostDsaPriv :: String