Revision ec85e3d5 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
1186 | 1186 |
cluster.cluster_name = clustername |
1187 | 1187 |
cluster.master_ip = ip |
1188 | 1188 |
self.cfg.Update(cluster) |
1189 |
|
|
1190 |
# update the known hosts file |
|
1191 |
ssh.WriteKnownHostsFile(self.cfg, constants.SSH_KNOWN_HOSTS_FILE) |
|
1192 |
node_list = self.cfg.GetNodeList() |
|
1193 |
try: |
|
1194 |
node_list.remove(master) |
|
1195 |
except ValueError: |
|
1196 |
pass |
|
1197 |
result = self.rpc.call_upload_file(node_list, |
|
1198 |
constants.SSH_KNOWN_HOSTS_FILE) |
|
1199 |
for to_node, to_result in result.iteritems(): |
|
1200 |
if to_result.failed or not to_result.data: |
|
1201 |
logging.error("Copy of file %s to node %s failed", fname, to_node) |
|
1202 |
|
|
1189 | 1203 |
finally: |
1190 | 1204 |
result = self.rpc.call_node_start_master(master, False) |
1191 | 1205 |
if result.failed or not result.data: |
... | ... | |
2024 | 2038 |
logging.debug("Copying hosts and known_hosts to all nodes") |
2025 | 2039 |
for fname in (constants.ETC_HOSTS, constants.SSH_KNOWN_HOSTS_FILE): |
2026 | 2040 |
result = self.rpc.call_upload_file(dist_nodes, fname) |
2027 |
for to_node in dist_nodes:
|
|
2028 |
if result[to_node].failed or not result[to_node]:
|
|
2041 |
for to_node, to_result in result.iteritems():
|
|
2042 |
if to_result.failed or not to_result.data:
|
|
2029 | 2043 |
logging.error("Copy of file %s to node %s failed", fname, to_node) |
2030 | 2044 |
|
2031 | 2045 |
to_copy = [] |
Also available in: Unified diff