Revision 1b54fc6c
b/lib/backend.py | ||
---|---|---|
1459 | 1459 |
|
1460 | 1460 |
""" |
1461 | 1461 |
if not os.path.isabs(file_name): |
1462 |
logging.error("Filename passed to UploadFile is not absolute: '%s'",
|
|
1463 |
file_name)
|
|
1464 |
return False
|
|
1462 |
err = "Filename passed to UploadFile is not absolute: '%s'" % file_name
|
|
1463 |
logging.error(err)
|
|
1464 |
return (False, err)
|
|
1465 | 1465 |
|
1466 | 1466 |
allowed_files = set([ |
1467 | 1467 |
constants.CLUSTER_CONF_FILE, |
... | ... | |
1477 | 1477 |
allowed_files.update(hv_class.GetAncillaryFiles()) |
1478 | 1478 |
|
1479 | 1479 |
if file_name not in allowed_files: |
1480 |
logging.error("Filename passed to UploadFile not in allowed" |
|
1481 |
" upload targets: '%s'", file_name) |
|
1482 |
return False |
|
1480 |
err = "Filename passed to UploadFile not in allowed upload targets: '%s'" \ |
|
1481 |
% file_name |
|
1482 |
logging.error(err) |
|
1483 |
return (False, err) |
|
1483 | 1484 |
|
1484 | 1485 |
raw_data = _Decompress(data) |
1485 | 1486 |
|
1486 | 1487 |
utils.WriteFile(file_name, data=raw_data, mode=mode, uid=uid, gid=gid, |
1487 | 1488 |
atime=atime, mtime=mtime) |
1488 |
return True
|
|
1489 |
return (True, "success")
|
|
1489 | 1490 |
|
1490 | 1491 |
|
1491 | 1492 |
def WriteSsconfFiles(values): |
b/lib/cmdlib.py | ||
---|---|---|
1381 | 1381 |
result = self.rpc.call_upload_file(node_list, |
1382 | 1382 |
constants.SSH_KNOWN_HOSTS_FILE) |
1383 | 1383 |
for to_node, to_result in result.iteritems(): |
1384 |
if to_result.failed or not to_result.data: |
|
1385 |
logging.error("Copy of file %s to node %s failed", |
|
1386 |
constants.SSH_KNOWN_HOSTS_FILE, to_node) |
|
1384 |
msg = to_result.RemoteFailMsg() |
|
1385 |
if msg: |
|
1386 |
msg = ("Copy of file %s to node %s failed: %s" % |
|
1387 |
(constants.SSH_KNOWN_HOSTS_FILE, to_node, msg)) |
|
1388 |
self.proc.LogWarning(msg) |
|
1387 | 1389 |
|
1388 | 1390 |
finally: |
1389 | 1391 |
result = self.rpc.call_node_start_master(master, False) |
... | ... | |
1583 | 1585 |
if os.path.exists(fname): |
1584 | 1586 |
result = lu.rpc.call_upload_file(dist_nodes, fname) |
1585 | 1587 |
for to_node, to_result in result.items(): |
1586 |
if to_result.failed or not to_result.data: |
|
1587 |
logging.error("Copy of file %s to node %s failed", fname, to_node) |
|
1588 |
msg = to_result.RemoteFailMsg() |
|
1589 |
if msg: |
|
1590 |
msg = ("Copy of file %s to node %s failed: %s" % |
|
1591 |
(fname, to_node, msg)) |
|
1592 |
lu.proc.LogWarning(msg) |
|
1588 | 1593 |
|
1589 | 1594 |
|
1590 | 1595 |
class LURedistributeConfig(NoHooksLU): |
b/lib/config.py | ||
---|---|---|
1066 | 1066 |
|
1067 | 1067 |
result = rpc.RpcRunner.call_upload_file(node_list, self._cfg_file, |
1068 | 1068 |
address_list=addr_list) |
1069 |
for node in node_list: |
|
1070 |
if not result[node]: |
|
1071 |
logging.error("copy of file %s to node %s failed", |
|
1072 |
self._cfg_file, node) |
|
1069 |
for to_node, to_result in result.items(): |
|
1070 |
msg = to_result.RemoteFailMsg() |
|
1071 |
if msg: |
|
1072 |
msg = ("Copy of file %s to node %s failed: %s" % |
|
1073 |
(self._cfg_file, node, msg)) |
|
1074 |
logging.error(msg) |
|
1073 | 1075 |
bad = True |
1074 | 1076 |
return not bad |
1075 | 1077 |
|
Also available in: Unified diff