Files
ironic/ironic/tests/unit/api
abhibongale bf9647502a fix: 'built_in' KeyError on invalid priority.
A KeyError for 'built_in' could occur in `ironic.api.method`
when processing node inspection rules if an invalid priority
(e.g., -1) was provided in a POST request. This resulted in a
500 server error.

This issue was identified while writing tests for inspection rule
priority as part of the work for LP#2105478. The
server-side error was observed in logs during POST requests to
`/baremetal/v1/nodes`, notably triggered by the
`tempest-TestInspectionRules` test, as seen in the log entry:
"ERROR ironic.api.method [...] Server-side error: "'built_in'""

This patch ensures the 'built_in' key is correctly accessed or
handled within the inspection rule processing logic, particularly
when validating or processing rule priorities, to prevent this error.

Related-Bug: 2105478
Change-Id: I3ecf95d316687bc6b82d28cdd945eaba8115aedf
2025-06-10 17:37:01 +01:00
..
2015-09-28 21:27:01 +00:00
2023-09-15 14:58:57 +02:00
2024-08-02 05:44:29 +01:00