X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/7ede9c6a9b3c79b79be39d3398b40c3a0ef8a845..3779121c8ce045b596cf649a2ea4de2131a61968:/lib/bootstrap.py diff --git a/lib/bootstrap.py b/lib/bootstrap.py index 1c6c5f6..7d25b49 100644 --- a/lib/bootstrap.py +++ b/lib/bootstrap.py @@ -61,7 +61,7 @@ def _InitSSHSetup(): permitted hosts and adds the hostkey to its own known hosts. """ - priv_key, pub_key, auth_keys = ssh.GetUserFiles(constants.GANETI_RUNAS) + priv_key, pub_key, auth_keys = ssh.GetUserFiles(constants.SSH_LOGIN_USER) for name in priv_key, pub_key: if os.path.exists(name): @@ -656,14 +656,11 @@ def SetupNodeDaemon(cluster_name, node, ssh_key_check): @param ssh_key_check: whether to do a strict key check """ - family = ssconf.SimpleStore().GetPrimaryIPFamily() + sstore = ssconf.SimpleStore() + family = sstore.GetPrimaryIPFamily() sshrunner = ssh.SshRunner(cluster_name, ipv6=(family == netutils.IP6Address.family)) - bind_address = constants.IP4_ADDRESS_ANY - if family == netutils.IP6Address.family: - bind_address = constants.IP6_ADDRESS_ANY - # set up inter-node password and certificate and restarts the node daemon # and then connect with ssh to set password and start ganeti-noded # note that all the below variables are sanitized at this point, @@ -673,11 +670,12 @@ def SetupNodeDaemon(cluster_name, node, ssh_key_check): sshrunner.CopyFileToNode(node, pathutils.SPICE_CERT_FILE) sshrunner.CopyFileToNode(node, pathutils.SPICE_CACERT_FILE) sshrunner.CopyFileToNode(node, pathutils.CONFD_HMAC_KEY) - mycommand = ("%s stop-all; %s start %s -b %s" % - (pathutils.DAEMON_UTIL, pathutils.DAEMON_UTIL, constants.NODED, - utils.ShellQuote(bind_address))) + for filename in sstore.GetFileList(): + sshrunner.CopyFileToNode(node, filename) + mycommand = ("%s stop-all; %s start %s" % + (pathutils.DAEMON_UTIL, pathutils.DAEMON_UTIL, constants.NODED)) - result = sshrunner.Run(node, "root", mycommand, batch=False, + result = sshrunner.Run(node, constants.SSH_LOGIN_USER, mycommand, batch=False, ask_key=ssh_key_check, use_cluster_key=True, strict_host_check=ssh_key_check)