Merge "fix: report a better error in validate-interfaces"

This commit is contained in:
Zuul 2026-01-07 15:20:01 +00:00 committed by Gerrit Code Review
commit c2b5580b75
2 changed files with 10 additions and 0 deletions

View file

@ -49,6 +49,11 @@ def get_interfaces(node, inventory):
result = {}
pxe_mac = get_pxe_mac(inventory)
if 'interfaces' not in inventory:
raise exception.InvalidNodeInventory(
node=node.uuid,
reason=_('no interfaces present in inventory'))
for iface in inventory['interfaces']:
name = iface.get('name')
mac = iface.get('mac_address')

View file

@ -0,0 +1,5 @@
---
fixes:
- |
Report a better error message than a KeyError when there are no interfaces
in the inspection data when running the validate-interfaces inspection hook.