From 48f85f752473448a8e9418985475f77db68fb0e7 Mon Sep 17 00:00:00 2001 From: Guido Trotter <ultrotter@google.com> Date: Thu, 1 Nov 2007 17:44:52 +0000 Subject: [PATCH] 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 --- scripts/gnt-os | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/gnt-os b/scripts/gnt-os index d422a1dcb..5de43d6d0 100755 --- a/scripts/gnt-os +++ b/scripts/gnt-os @@ -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)" % + (_DiagnoseOSStatus(first_os), + _DiagnoseOSPath(first_os))) if _DiagnoseOSValid(first_os): - nodes_valid[node_name] = first_os_status + nodes_valid[node_name] = first_os_msg else: - nodes_bad[node_name] = first_os_status + nodes_bad[node_name] = first_os_msg else: nodes_bad[node_name] = "OS not found" @@ -217,11 +219,11 @@ def DiagnoseOS(opts, args): "[hidden] %s" % _DiagnoseOSStatus(dobj))) - 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]: _OutputNodeHiddenOSStatus(all_os[os_name][node_name]) -- GitLab