Revision c4b6c29c

b/lib/bootstrap.py
243 243
    logging.warning("Could not shutdown the node daemon and cleanup the node")
244 244

  
245 245

  
246
def SetupNodeDaemon(node):
246
def SetupNodeDaemon(node, ssh_key_check):
247 247
  """Add a node to the cluster.
248 248

  
249 249
  This function must be called before the actual opcode, and will ssh
......
285 285
                constants.SSL_CERT_FILE, gntpem,
286 286
                constants.NODE_INITD_SCRIPT))
287 287

  
288
  result = sshrunner.Run(node, 'root', mycommand, batch=False, ask_key=True,
289
                         use_cluster_key=False)
288
  result = sshrunner.Run(node, 'root', mycommand, batch=False,
289
                         ask_key=ssh_key_check,
290
                         use_cluster_key=False,
291
                         strict_host_check=ssh_key_check)
290 292
  if result.failed:
291 293
    raise errors.OpExecError("Remote command on node %s, error: %s,"
292 294
                             " output: %s" %
b/scripts/gnt-node
61 61
    "on the target machine (%s) with the ones of the current one\n"
62 62
    "and grant full intra-cluster ssh root access to/from it\n" % node)
63 63

  
64
  bootstrap.SetupNodeDaemon(node)
64
  bootstrap.SetupNodeDaemon(node, opts.ssh_key_check)
65 65

  
66 66
  op = opcodes.OpAddNode(node_name=args[0], secondary_ip=opts.secondary_ip,
67 67
                         readd=opts.readd)
......
314 314
           make_option("--readd", dest="readd",
315 315
                       default=False, action="store_true",
316 316
                       help="Readd old node after replacing it"),
317
           make_option("--no-ssh-key-check", dest="ssh_key_check",
318
                       default=True, action="store_false",
319
                       help="Disable SSH key fingerprint checking"),
317 320
           ],
318
          "[-s ip] [--readd] <node_name>", "Add a node to the cluster"),
321
          "[-s ip] [--readd] [--no-ssh-key-check] <node_name>",
322
          "Add a node to the cluster"),
319 323
  'evacuate': (EvacuateNode, ARGS_FIXED(2),
320 324
               [DEBUG_OPT, FORCE_OPT],
321 325
               "[-f] <src> <dst>",

Also available in: Unified diff