Commit b5acfa2
committed
refactor(base): get_worst() accepts variadic states
Make `get_worst()` variadic (`*states`) so plugins that need to combine
three or more states in one call can do so without nesting:
state = lib.base.get_worst(state, used_state, committed_state)
instead of
state = lib.base.get_worst(state, lib.base.get_worst(used_state, committed_state))
Existing two-argument callers keep working unchanged. Calling with no
arguments returns STATE_OK.
Needed for the `state +=` fixes in the monitoring-plugins audit backlog
(#120 sibling issue on monitoring-plugins), where several wildfly /
starface plugins currently combine three states via the broken
`state += get_worst(...)` pattern.1 parent b530b1a commit b5acfa2
2 files changed
Lines changed: 19 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | | - | |
298 | | - | |
299 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
| 302 | + | |
302 | 303 | | |
303 | 304 | | |
304 | | - | |
305 | | - | |
| 305 | + | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
316 | 319 | | |
317 | | - | |
318 | | - | |
319 | | - | |
| 320 | + | |
| 321 | + | |
320 | 322 | | |
321 | | - | |
| 323 | + | |
322 | 324 | | |
323 | | - | |
| 325 | + | |
324 | 326 | | |
325 | 327 | | |
326 | 328 | | |
| |||
0 commit comments