Browse Source

Trivial: better guard against malformed data in extra_hardware

We already catch IndexError when processing a line, but not other
errors. A recent regression in python-hardware caused it to raise
TypeError.

Change-Id: Ic6615c1b4017df66783829e54b9f716a9e65b916
changes/85/789285/1
Dmitry Tantsur 2 weeks ago
parent
commit
de839a509d
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      ironic_inspector/plugins/extra_hardware.py

+ 2
- 2
ironic_inspector/plugins/extra_hardware.py View File

@ -79,8 +79,8 @@ class ExtraHardwareHook(base.ProcessingHook):
pass
converted_1[item[2]] = item[3]
except IndexError:
LOG.warning('Ignoring invalid extra data item %s', item,
except Exception as e:
LOG.warning('Ignoring invalid extra data item %s: %s', item, e,
node_info=node_info, data=introspection_data)
introspection_data['extra'] = converted


Loading…
Cancel
Save