Skip to content
Snippets Groups Projects
Commit ebae9e37 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

prepare_node_join: Move daemon SSH files to constants


This dictionary will also be useful in “gnt-node add”.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 340ae7da
No related branches found
No related tags found
No related merge requests found
......@@ -2060,5 +2060,11 @@ 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
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),
}
# Do not re-export imported modules
del re, _vcsversion, _autoconf, socket, pathutils
......@@ -58,13 +58,6 @@ _DATA_CHECK = ht.TStrictDict(False, True, {
constants.SSHS_SSH_ROOT_KEY: _SSH_KEY_LIST,
})
_SSH_DAEMON_KEYFILES = {
constants.SSHK_RSA:
(pathutils.SSH_HOST_RSA_PRIV, pathutils.SSH_HOST_RSA_PUB),
constants.SSHK_DSA:
(pathutils.SSH_HOST_DSA_PRIV, pathutils.SSH_HOST_DSA_PUB),
}
class JoinError(errors.GenericError):
"""Local class for reporting errors.
......@@ -258,7 +251,7 @@ def UpdateSshDaemon(data, dry_run, _runcmd_fn=utils.RunCmd,
return
if _keyfiles is None:
_keyfiles = _SSH_DAEMON_KEYFILES
_keyfiles = constants.SSH_DAEMON_KEYFILES
logging.info("Updating SSH daemon key files")
_UpdateKeyFiles(keys, dry_run, _keyfiles)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment