BGP state monitor sets Event
values of incorrect types, causing strange Pydantic serialization errors
#312
Labels
bug
Something isn't working
When running Zino 2.0.0-beta.1 on real world devices, it intermittently logs a bunch of errors like this:
This appears to be mainly be caused by how this dataclass is used:
zino/src/zino/tasks/bgpstatemonitortask.py
Lines 55 to 61 in c9909f3
Instances of this class are fed raw string values (as collected through SNMP and parsed through the BGP mibs) as attribute values, not values of the actual annotated types.
Later, these values are fed directly into
BGPEvent
object attributes: But these objects are Pydantic model instances and do not expect strings as values for attributes such asbgpos
andbgpas
. As the data is serialized, it complains that these fields aren't the expected enum typesBGPOperState
andBGPAdminStatus
:zino/src/zino/statemodels.py
Lines 355 to 361 in 938cdc7
The text was updated successfully, but these errors were encountered: