Revision 107b0ccb scripts/gnt-os
b/scripts/gnt-os | ||
---|---|---|
174 | 174 |
node_data = result |
175 | 175 |
all_os = _DiagnoseByOS(node_data) |
176 | 176 |
|
177 |
format = "%-*s %-*s %s" |
|
178 |
|
|
179 |
max_name = len('Name') |
|
180 |
if all_os: |
|
181 |
max_name = max(max_name, max([len(name) for name in all_os])) |
|
182 |
|
|
183 |
max_node = len('Status/Node') |
|
184 |
max_node = max(max_node, max([len(name) for name in node_data])) |
|
185 |
|
|
186 |
logger.ToStdout(format % (max_name, 'Name', max_node, 'Status/Node', |
|
187 |
'Details')) |
|
188 |
|
|
189 | 177 |
has_bad = False |
190 | 178 |
|
191 | 179 |
for os_name in all_os: |
... | ... | |
215 | 203 |
|
216 | 204 |
def _OutputNodeHiddenOSStatus(dobj_list): |
217 | 205 |
for dobj in dobj_list: |
218 |
logger.ToStdout(format % (max_name, "", max_node, "", |
|
219 |
"[hidden] %s" % |
|
220 |
_DiagnoseOSStatus(dobj))) |
|
206 |
logger.ToStdout(" [hidden] path: %s, status: %s" % |
|
207 |
(_DiagnoseOSPath(dobj), _DiagnoseOSStatus(dobj))) |
|
221 | 208 |
|
222 | 209 |
def _OutputPerNodeOSStatus(msg_map): |
223 | 210 |
map_k = utils.NiceSort(msg_map.keys()) |
224 | 211 |
for node_name in map_k: |
225 |
logger.ToStdout(format % (max_name, "", max_node,
|
|
226 |
node_name, msg_map[node_name]))
|
|
212 |
logger.ToStdout(" Node: %s, status: %s" %
|
|
213 |
(node_name, msg_map[node_name]))
|
|
227 | 214 |
if node_name in all_os[os_name]: |
228 | 215 |
_OutputNodeHiddenOSStatus(all_os[os_name][node_name]) |
229 | 216 |
|
230 |
logger.ToStdout(format % (max_name, os_name, max_node, status, ""))
|
|
217 |
logger.ToStdout("OS: %s [global status: %s]" % (os_name, status))
|
|
231 | 218 |
_OutputPerNodeOSStatus(nodes_valid) |
232 | 219 |
_OutputPerNodeOSStatus(nodes_bad) |
233 | 220 |
|
Also available in: Unified diff