Werk #19884 · Jul 8, 26
Fix crash in REST API host endpoints when inventory data is JSON-encoded
Since Werk #18032, inventory trees are saved as JSON. However, some hosts may still have inventory data stored in the older Python-repr format.
The REST API host endpoints (cmk/list and cmk/show) always parsed the
mk_inventory column with ast.literal_eval, which cannot handle JSON's
true/false/null literals. As a result, requesting this column crashed for
hosts whose inventory data was already stored as JSON.
The endpoints now understand both formats: they first try to parse the column as
JSON, and only fall back to ast.literal_eval for hosts that still carry
inventory data in the legacy Python-repr format.
Details
- Class:
- Bug Fixes
- Level:
- Trivial
- Component:
- REST API
- Versions:
- 3.0.0b1Not yet releasedAll Editions
- 2.5.0p9All Editions