Revision 05ccd983

b/scripts/gnt-node
37 37
  ]
38 38

  
39 39
def AddNode(opts, args):
40
  """Add node cli-to-processor bridge."""
40
  """Add node cli-to-processor bridge.
41

  
42
  """
43
  dns_data = utils.HostInfo(args[0])
44
  node = dns_data.name
45

  
46
  if not opts.readd:
47
    op = opcodes.OpQueryNodes(output_fields=['name'], names=[node])
48
    try:
49
      output = SubmitOpCode(op)
50
    except (errors.OpPrereqError, errors.OpExecError):
51
      pass
52
    else:
53
      logger.ToStderr("Node %s already in the cluster (as %s)"
54
                      " - please use --readd" % (args[0], output[0][0]))
55
      return 1
56

  
41 57
  logger.ToStderr("-- WARNING -- \n"
42 58
    "Performing this operation is going to replace the ssh daemon keypair\n"
43 59
    "on the target machine (%s) with the ones of the current one\n"
44
    "and grant full intra-cluster ssh root access to/from it\n" % args[0])
60
    "and grant full intra-cluster ssh root access to/from it\n" % node)
61

  
45 62
  op = opcodes.OpAddNode(node_name=args[0], secondary_ip=opts.secondary_ip,
46 63
                         readd=opts.readd)
47 64
  SubmitOpCode(op)

Also available in: Unified diff