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

fix: Update correct datatype for Arista extended communities #260

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

szferguson
Copy link

@szferguson szferguson commented Jun 9, 2024

Description

This fixes a parsing issue where AristaRouteDetail expects a string for ext_community_list_raw but EOS returns an integer in the json formatted response

Related Issues

#252

Motivation and Context

On some of our routers, we make use of extended communities. For each extended community in the extCommunityListRaw array returned by EOS, it is an integer and not returned as string. Example:

"extCommunityListRaw": [
    595497215591610,
    876972192302256
],

Tests

When the AristaRouteDetail expects a string for ext_community_list_raw, the following error is produced:

[CRITICAL] 20240609 07:17:42 |66 | parse_arista → 11 validation errors for AristaBGPTable
bgpRouteEntries.`1.1.1.0/24`.bgpRoutePaths.0.routeDetail.extCommunityListRaw.0
  Input should be a valid string [type=string_type, input_value=595497215591610, input_type=int]
    For further information visit https://errors.pydantic.dev/2.7/v/string_type
bgpRouteEntries.`1.1.1.0/24`.bgpRoutePaths.0.routeDetail.extCommunityListRaw.1
  Input should be a valid string [type=string_type, input_value=876972192302256, input_type=int]
    For further information visit https://errors.pydantic.dev/2.7/v/string_type
bgpRouteEntries.`1.1.1.0/24`.bgpRoutePaths.1.routeDetail.extCommunityListRaw.0

When replaced with int, these parse errors no longer appear, and the table is rendered correctly.

This fixes a parsing issue where AristaRouteDetail expects a string for ext_community_list_raw but EOS returns an integer in the json formatted response
@szferguson szferguson changed the title Update arista_eos.py Update correct datatype for Arista extended communities Jun 9, 2024
@szferguson szferguson changed the title Update correct datatype for Arista extended communities fix: Update correct datatype for Arista extended communities Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant