Ignore non-metrics notifications in PrometheusFileDriver
The PrometheusFileDriver is registered as an oslo.messaging notification driver and therefore receives every notification ironic emits, not just sensor data. Versioned notifications such as NodeSetPowerStatePayload fell through to the file-writing path, where the node identifier (node_name/node_uuid/hostname) is absent from the versioned object payload, causing:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'The driver now only processes metrics notifications and ignores everything else. Metrics notifications are the conductor event type ‘ironic.metrics’ and the node sensor event types, which ironic builds as ‘hardware.{node.driver}.metrics’. The node event type is matched by pattern rather than an explicit list because the middle segment is the node’s hardware type and can be any value registered in the deployment, so an explicit list would silently drop sensor data for hardware types such as ilo or irmc.
Node notifications for hardware types without a dedicated parser keep their previous behaviour of exporting only the header timestamp metric. As a defensive measure, payloads lacking a usable identifier are now skipped with a warning instead of crashing.
Closes-Bug: #2166070 Change-Id: I3f65aa72b5dfd5df4536fa74ef393f6c6ad4641f Signed-off-by: Antony Messerli antony@mes.ser.li
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号