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

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 @@ ...@@ -29,6 +29,7 @@
import sys import sys
from ganeti.cli import * from ganeti.cli import *
from ganeti import bootstrap
from ganeti import opcodes from ganeti import opcodes
from ganeti import utils from ganeti import utils
from ganeti import constants from ganeti import constants
...@@ -147,6 +148,8 @@ def _RunSetupSSH(options, nodes): ...@@ -147,6 +148,8 @@ def _RunSetupSSH(options, nodes):
cmd.append("--debug") cmd.append("--debug")
elif options.verbose: elif options.verbose:
cmd.append("--verbose") cmd.append("--verbose")
if options.ssh_key_check:
cmd.append("--no-ssh-key-check")
cmd.extend(nodes) cmd.extend(nodes)
...@@ -195,8 +198,9 @@ def AddNode(opts, args): ...@@ -195,8 +198,9 @@ def AddNode(opts, args):
# read the cluster name from the master # read the cluster name from the master
output = cl.QueryConfigValues(['cluster_name']) output = cl.QueryConfigValues(['cluster_name'])
cluster_name = output[0]
if not readd: if not readd and opts.node_setup:
ToStderr("-- WARNING -- \n" ToStderr("-- WARNING -- \n"
"Performing this operation is going to replace the ssh daemon" "Performing this operation is going to replace the ssh daemon"
" keypair\n" " keypair\n"
...@@ -207,6 +211,8 @@ def AddNode(opts, args): ...@@ -207,6 +211,8 @@ def AddNode(opts, args):
if opts.node_setup: if opts.node_setup:
_RunSetupSSH(opts, [node]) _RunSetupSSH(opts, [node])
bootstrap.SetupNodeDaemon(cluster_name, node, opts.ssh_key_check)
op = opcodes.OpAddNode(node_name=args[0], secondary_ip=sip, op = opcodes.OpAddNode(node_name=args[0], secondary_ip=sip,
readd=opts.readd) readd=opts.readd)
SubmitOpCode(op, opts=opts) SubmitOpCode(op, opts=opts)
...@@ -667,8 +673,9 @@ def SetNodeParams(opts, args): ...@@ -667,8 +673,9 @@ def SetNodeParams(opts, args):
commands = { commands = {
'add': ( 'add': (
AddNode, [ArgHost(min=1, max=1)], AddNode, [ArgHost(min=1, max=1)],
[SECONDARY_IP_OPT, READD_OPT, NONODE_SETUP_OPT, VERBOSE_OPT], [SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT, NONODE_SETUP_OPT,
"[-s ip] [--readd] [--no-node-setup] [--verbose] " VERBOSE_OPT],
"[-s ip] [--readd] [--no-ssh-key-check] [--no-node-setup] [--verbose] "
" <node_name>", " <node_name>",
"Add a node to the cluster"), "Add a node to the cluster"),
'evacuate': ( 'evacuate': (
......
...@@ -153,20 +153,6 @@ def SetupSSH(transport): ...@@ -153,20 +153,6 @@ def SetupSSH(transport):
_InvokeDaemonUtil(transport, "reload-ssh-keys") _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(): def ParseOptions():
"""Parses options passed to program. """Parses options passed to program.
...@@ -383,7 +369,6 @@ def main(): ...@@ -383,7 +369,6 @@ def main():
try: try:
try: try:
SetupSSH(transport) SetupSSH(transport)
SetupNodeDaemon(transport)
except errors.GenericError, err: except errors.GenericError, err:
logging.error("While doing setup on host %s an error occured: %s", logging.error("While doing setup on host %s an error occured: %s",
host, err) 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