aristanetworks / cloudvision-python

Python resources and libraries for integrating with Arista's CloudVision platform
Apache License 2.0
25 stars 17 forks source link

fix decode error for non valid ascii characters #6

Closed barryCrunch closed 2 years ago

barryCrunch commented 2 years ago

In reference to issue #5

This is to resolve an issue where the ascii decode cannot successfully decode all of the characters in the BGPOpensent messages. Adding the ignore statement will allow the code to progress even when it comes across a non-valid ascii character.

cianmcgrath commented 2 years ago

I'm not familiar with the non-ascii characters used in the BGPOpensent messages. Adding the ignore will just drop these. Is there any useful information in these non-standard characters? Should we use backslashreplace instead of ignore?

barryCrunch commented 2 years ago

I'm not sure what the receivedOpenMessage contains as far as data, but the openMessage itself contains negotiation parameters. When I decode the value presented in the CloudVision portal it is just a whole lot of random unicode characters.

image

Is Cloudvision pulling it from the switch based on some openconfig spec? If so I could probably go dig into and find out what is supposed to be there. Without doing that, I don't see any useful info in that message.

cianmcgrath commented 2 years ago

I haven't been able to find any information confirming whether Cloudvision is pulling it from some openconfig spec. AFAIK there are also no plans for there to be any useful information transmitted in a non-ascii form in any situation, so we'll go ahead and merge this and revisit it if that changes in the future.

Thanks for digging into the issue and opening the pr! 😁 👍