Revision 87622829 scripts/gnt-node
b/scripts/gnt-node | ||
---|---|---|
53 | 53 |
@return: the desired exit code |
54 | 54 |
|
55 | 55 |
""" |
56 |
cl = GetClient() |
|
56 | 57 |
dns_data = utils.HostInfo(args[0]) |
57 | 58 |
node = dns_data.name |
58 | 59 |
|
59 | 60 |
if not opts.readd: |
60 |
op = opcodes.OpQueryNodes(output_fields=['name'], names=[node]) |
|
61 | 61 |
try: |
62 |
output = SubmitOpCode(op)
|
|
62 |
output = cl.QueryNodes(names=[node], fields=['name'])
|
|
63 | 63 |
except (errors.OpPrereqError, errors.OpExecError): |
64 | 64 |
pass |
65 | 65 |
else: |
... | ... | |
67 | 67 |
" - please use --readd", args[0], output[0][0]) |
68 | 68 |
return 1 |
69 | 69 |
|
70 |
# read the cluster name from the master |
|
71 |
output = cl.QueryConfigValues(['cluster_name']) |
|
72 |
cluster_name = output[0] |
|
73 |
|
|
70 | 74 |
ToStderr("-- WARNING -- \n" |
71 | 75 |
"Performing this operation is going to replace the ssh daemon" |
72 | 76 |
" keypair\n" |
... | ... | |
74 | 78 |
" current one\n" |
75 | 79 |
"and grant full intra-cluster ssh root access to/from it\n", node) |
76 | 80 |
|
77 |
bootstrap.SetupNodeDaemon(node, opts.ssh_key_check) |
|
81 |
bootstrap.SetupNodeDaemon(cluster_name, node, opts.ssh_key_check)
|
|
78 | 82 |
|
79 | 83 |
op = opcodes.OpAddNode(node_name=args[0], secondary_ip=opts.secondary_ip, |
80 | 84 |
readd=opts.readd) |
Also available in: Unified diff