Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coerce BaseBGPRow attribute values to expected types #313

Merged
merged 4 commits into from
Jul 23, 2024

Commits on Jul 23, 2024

  1. Add regression test for #312

    This requires Pydantic >= 2.7.0, as this is the first version that
    enables serialization warnings to be turned into errors/exceptions,
    which will trigger this test.
    lunkwill42 authored and johannaengland committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    943c317 View commit details
    Browse the repository at this point in the history
  2. Coerce BaseBGPRow attribute to expected types

    This fixes #312 by type-casting incoming attributes on BaseBGPRow.
    The expected Enum types have values designed to match the state strings
    from the BGP MIBs, so coercing the strings as early as possible
    should do.
    lunkwill42 authored and johannaengland committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    bd05f4d View commit details
    Browse the repository at this point in the history
  3. Use enums instead of literals for comparisons

    While the code works, its always cleaner (and easier to type check)
    to refer to the Enum values rather than compare against string
    literals (which could be both redundant and incorrect).
    lunkwill42 authored and johannaengland committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    d3018d3 View commit details
    Browse the repository at this point in the history
  4. Add news fragment

    lunkwill42 authored and johannaengland committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    44e06b8 View commit details
    Browse the repository at this point in the history