Commit 48f85f75 authored by Guido Trotter's avatar Guido Trotter
Browse files

Change the way to compute the first os status message

Use both _DiagnoseOSStatus and  _DiagnoseOSPath to calculate the message
associated with the first entry found on a node for an OS. Also call the rename
the relevant variables to _msg rather than just _status to reflect that they
contain a bit more than just the bare status message.

Reviewed-By: imsnah
parent 5efc50fc
......@@ -194,11 +194,13 @@ def DiagnoseOS(opts, args):
for node_name in node_data:
if node_name in all_os[os_name]:
first_os = all_os[os_name][node_name].pop(0)
first_os_status = _DiagnoseOSStatus(first_os)
first_os_msg = ("%s (path: %s)" %
if _DiagnoseOSValid(first_os):
nodes_valid[node_name] = first_os_status
nodes_valid[node_name] = first_os_msg
nodes_bad[node_name] = first_os_status
nodes_bad[node_name] = first_os_msg
nodes_bad[node_name] = "OS not found"
......@@ -217,11 +219,11 @@ def DiagnoseOS(opts, args):
"[hidden] %s" %
def _OutputPerNodeOSStatus(status_map):
map_k = utils.NiceSort(status_map.keys())
def _OutputPerNodeOSStatus(msg_map):
map_k = utils.NiceSort(msg_map.keys())
for node_name in map_k:
logger.ToStdout(format % (max_name, "", max_node,
node_name, status_map[node_name]))
node_name, msg_map[node_name]))
if node_name in all_os[os_name]:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment