Commit 4c6029a
committed
19879 nvidia_smi: don't crash when no GPU is found
The bash agent plugin emits the section header before running
nvidia-smi -q -x, so any non-XML output (Linux "No devices were
found", Windows "ERROR: nvidia-smi.exe was not found in: ...")
was passed verbatim to ElementTree.fromstring and crashed
parse_nvidia_smi with ParseError. Treat ParseError as an empty
section.
Crash-Group-ID: 3616
Jira: SUP-28831
AI-Generated: true
Change-Id: I6bf22854809ab0ba4c1d5598a6162a53a8ac9fb01 parent 2c40681 commit 4c6029a
3 files changed
Lines changed: 57 additions & 26 deletions
File tree
- .werks
- cmk/plugins/nvidia/agent_based
- tests/unit/cmk/plugins/nvidia/agent_based
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
| |||
Lines changed: 22 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
284 | 282 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | 283 | | |
291 | 284 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
299 | 292 | | |
300 | | - | |
| 293 | + | |
301 | 294 | | |
302 | | - | |
| 295 | + | |
| 296 | + | |
303 | 297 | | |
304 | 298 | | |
305 | 299 | | |
306 | 300 | | |
307 | 301 | | |
308 | 302 | | |
309 | 303 | | |
| 304 | + | |
310 | 305 | | |
311 | 306 | | |
312 | 307 | | |
313 | 308 | | |
314 | | - | |
315 | | - | |
316 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
317 | 314 | | |
318 | 315 | | |
319 | 316 | | |
| |||
0 commit comments