Commit 3ef51126 authored by René Nussbaumer's avatar René Nussbaumer

Revert behaviour for calling SetupNodeDaemon

This was previously done in setup-ssh which was the wrong place
Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 9294514d
......@@ -29,6 +29,7 @@
import sys
from ganeti.cli import *
from ganeti import bootstrap
from ganeti import opcodes
from ganeti import utils
from ganeti import constants
......@@ -147,6 +148,8 @@ def _RunSetupSSH(options, nodes):
cmd.append("--debug")
elif options.verbose:
cmd.append("--verbose")
if options.ssh_key_check:
cmd.append("--no-ssh-key-check")
cmd.extend(nodes)
......@@ -195,8 +198,9 @@ def AddNode(opts, args):
# read the cluster name from the master
output = cl.QueryConfigValues(['cluster_name'])
cluster_name = output[0]
if not readd:
if not readd and opts.node_setup:
ToStderr("-- WARNING -- \n"
"Performing this operation is going to replace the ssh daemon"
" keypair\n"
......@@ -207,6 +211,8 @@ def AddNode(opts, args):
if opts.node_setup:
_RunSetupSSH(opts, [node])
bootstrap.SetupNodeDaemon(cluster_name, node, opts.ssh_key_check)
op = opcodes.OpAddNode(node_name=args[0], secondary_ip=sip,
readd=opts.readd)
SubmitOpCode(op, opts=opts)
......@@ -667,8 +673,9 @@ def SetNodeParams(opts, args):
commands = {
'add': (
AddNode, [ArgHost(min=1, max=1)],
[SECONDARY_IP_OPT, READD_OPT, NONODE_SETUP_OPT, VERBOSE_OPT],
"[-s ip] [--readd] [--no-node-setup] [--verbose] "
[SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT, NONODE_SETUP_OPT,
VERBOSE_OPT],
"[-s ip] [--readd] [--no-ssh-key-check] [--no-node-setup] [--verbose] "
" <node_name>",
"Add a node to the cluster"),
'evacuate': (
......
......@@ -153,20 +153,6 @@ def SetupSSH(transport):
_InvokeDaemonUtil(transport, "reload-ssh-keys")
def SetupNodeDaemon(transport):
"""Sets the node daemon up on the other side.
@param transport: The paramiko transport instance
"""
noded_cert = utils.ReadFile(constants.NODED_CERT_FILE)
sftp = transport.open_sftp_client()
_WriteSftpFile(sftp, constants.NODED_CERT_FILE, 0400, noded_cert)
_InvokeDaemonUtil(transport, "start %s" % constants.NODED)
def ParseOptions():
"""Parses options passed to program.
......@@ -383,7 +369,6 @@ def main():
try:
try:
SetupSSH(transport)
SetupNodeDaemon(transport)
except errors.GenericError, err:
logging.error("While doing setup on host %s an error occured: %s",
host, err)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment