From 33ee48613f26427495969318745f9f61c0d92fdf Mon Sep 17 00:00:00 2001 From: "Jose A. Lopes" Date: Fri, 4 Oct 2013 19:43:11 +0200 Subject: [PATCH] Hs2Py constants: hail, opcode, and SSH Add hail, opcode, and SSH related constants to the Haskell to Python constant generation. Signed-off-by: Jose A. Lopes Reviewed-by: Thomas Thrainer --- lib/constants.py | 43 +++++++++++++++++---------------------- src/Ganeti/HsConstants.hs | 49 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 25 deletions(-) diff --git a/lib/constants.py b/lib/constants.py index db20968..197a023 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -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), diff --git a/src/Ganeti/HsConstants.hs b/src/Ganeti/HsConstants.hs index 559d0a0..874867b 100644 --- a/src/Ganeti/HsConstants.hs +++ b/src/Ganeti/HsConstants.hs @@ -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 -- 1.7.10.4