add Huawei bgp route structured output #346
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds structured output support for the BGP route directive on Huawei VRP devices.
It introduces a parser for the raw response of the commands:
The parsed output is converted into a standardized structure compatible with Hyperglass, ensuring consistent display and data handling across different network platforms.
Related Issues
The request likely overlaps with PR #340 in certain areas.
However, this PR focuses on resolving one specific issue. The implementation is clean, well-structured, and scalable.
It complies with the project’s linting standards, is formatted using Black, and all pytest tests have passed successfully.
Motivation and Context
Previously, Hyperglass could not properly interpret BGP route information from Huawei VRP devices because the CLI output was unstructured. This update enables accurate parsing and structured representation of Huawei BGP route data, improving multi-vendor interoperability and user experience.
Tests
Test Environment: Docker on Ubuntu 24.04 + Manual installation on Ubuntu 24.04
Devices Tested: Huawei NE40E and Huawei NetEngine 8000 F
Test Cases:
Info: The network does not exist.when the route is not present in the RIB.Nilvalue in the AS_PATH are correctly recognized and processed as local prefixes.