Revision 2fa74ef4 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
3446 | 3446 |
if result.offline: |
3447 | 3447 |
# offline nodes will be in both lists |
3448 | 3448 |
off_nodes.append(name) |
3449 |
if result.failed: |
|
3449 |
if result.failed or result.RemoteFailMsg():
|
|
3450 | 3450 |
bad_nodes.append(name) |
3451 | 3451 |
else: |
3452 |
if result.data:
|
|
3453 |
live_data.update(result.data)
|
|
3454 |
# else no instance is alive
|
|
3452 |
if result.payload:
|
|
3453 |
live_data.update(result.payload)
|
|
3454 |
# else no instance is alive |
|
3455 | 3455 |
else: |
3456 | 3456 |
live_data = dict([(name, {}) for name in instance_names]) |
3457 | 3457 |
|
... | ... | |
6914 | 6914 |
nresult.Raise() |
6915 | 6915 |
if not isinstance(nresult.data, dict): |
6916 | 6916 |
raise errors.OpExecError("Can't get data for node %s" % nname) |
6917 |
msg = node_iinfo[nname].RemoteFailMsg() |
|
6918 |
if msg: |
|
6919 |
raise errors.OpExecError("Can't get node instance info" |
|
6920 |
" from node %s: %s" % (nname, msg)) |
|
6917 | 6921 |
remote_info = nresult.data |
6918 | 6922 |
for attr in ['memory_total', 'memory_free', 'memory_dom0', |
6919 | 6923 |
'vg_size', 'vg_free', 'cpu_total']: |
... | ... | |
6930 | 6934 |
for iinfo, beinfo in i_list: |
6931 | 6935 |
if iinfo.primary_node == nname: |
6932 | 6936 |
i_p_mem += beinfo[constants.BE_MEMORY] |
6933 |
if iinfo.name not in node_iinfo[nname].data:
|
|
6937 |
if iinfo.name not in node_iinfo[nname].payload:
|
|
6934 | 6938 |
i_used_mem = 0 |
6935 | 6939 |
else: |
6936 |
i_used_mem = int(node_iinfo[nname].data[iinfo.name]['memory'])
|
|
6940 |
i_used_mem = int(node_iinfo[nname].payload[iinfo.name]['memory'])
|
|
6937 | 6941 |
i_mem_diff = beinfo[constants.BE_MEMORY] - i_used_mem |
6938 | 6942 |
remote_info['memory_free'] -= max(0, i_mem_diff) |
6939 | 6943 |
|
Also available in: Unified diff