From 9294514de9a7678039cb5d48ef528b8b2edc238d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Nussbaumer?= Date: Thu, 19 Aug 2010 14:38:22 +0200 Subject: [PATCH] Change bootstrap.SetupDaemonNode to use scp as we can assume SSH is setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: René Nussbaumer Reviewed-by: Manuel Franceschini Reviewed-by: Guido Trotter Reviewed-by: Iustin Pop --- lib/bootstrap.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/lib/bootstrap.py b/lib/bootstrap.py index 5a0789509..8a7ffdd7e 100644 --- a/lib/bootstrap.py +++ b/lib/bootstrap.py @@ -512,26 +512,15 @@ def SetupNodeDaemon(cluster_name, node, ssh_key_check): # and then connect with ssh to set password and start ganeti-noded # note that all the below variables are sanitized at this point, # either by being constants or by the checks above - # TODO: Could this command exceed a shell's maximum command length? - mycommand = ("umask 077 && " - "cat > '%s' << '!EOF.' && \n" - "%s!EOF.\n" - "cat > '%s' << '!EOF.' && \n" - "%s!EOF.\n" - "cat > '%s' << '!EOF.' && \n" - "%s!EOF.\n" - "chmod 0400 %s %s %s && " - "%s start %s -b '%s'" % - (constants.NODED_CERT_FILE, noded_cert, - constants.RAPI_CERT_FILE, rapi_cert, - constants.CONFD_HMAC_KEY, confd_hmac_key, - constants.NODED_CERT_FILE, constants.RAPI_CERT_FILE, - constants.CONFD_HMAC_KEY, - constants.DAEMON_UTIL, constants.NODED, bind_address)) + sshrunner.CopyFileToNode(node, constants.NODED_CERT_FILE) + sshrunner.CopyFileToNode(node, constants.RAPI_CERT_FILE) + sshrunner.CopyFileToNode(node, constants.CONFD_HMAC_KEY) + mycommand = ("%s start %s -b '%s'" % (constants.DAEMON_UTIL, constants.NODED, + bind_address)) result = sshrunner.Run(node, 'root', mycommand, batch=False, ask_key=ssh_key_check, - use_cluster_key=False, + use_cluster_key=True, strict_host_check=ssh_key_check) if result.failed: raise errors.OpExecError("Remote command on node %s, error: %s," -- GitLab