Skip to content

add huawei_vrp platform#238

Merged
jtdub merged 6 commits intonetdevops:masterfrom
yanpla:huawei-vrpv8
Mar 25, 2026
Merged

add huawei_vrp platform#238
jtdub merged 6 commits intonetdevops:masterfrom
yanpla:huawei-vrpv8

Conversation

@yanpla
Copy link
Contributor

@yanpla yanpla commented Mar 25, 2026

This PR adds the huawei_vrpv8 platform.

Tests pass,
other huawei versions might also work with this but I chose huawei_vrpv8 naming as it's also used in Netmiko

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new Huawei VRPv8 platform to the hier_config platform/driver system, enabling correct negation behavior (undo ...), comment stripping, and Huawei-style sectional exiting (quit) when generating remediation configs.

Changes:

  • Added Platform.HUAWEI_VRPV8 and wired it into driver construction and v2→v3 platform mapping.
  • Implemented a new HConfigDriverHuaweiVrpv8 with Huawei-specific negation and quit sectional exits.
  • Added a dedicated Huawei VRPv8 driver test suite and refactored sectional exit logic to be driver-overridable.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_driver_huawei_vrpv8.py Adds tests covering Huawei VRPv8 negation behavior, comment stripping, and quit sectional exits.
hier_config/utils.py Extends v2→v3 platform string mapping to include huawei_vrpv8.
hier_config/platforms/huawei_vrpv8/driver.py New Huawei VRPv8 driver implementing undo negation rules and quit sectional exiting.
hier_config/platforms/huawei_vrpv8/init.py Adds package marker for the new platform module.
hier_config/platforms/driver_base.py Centralizes sectional-exit computation on the driver to support platform overrides.
hier_config/models.py Adds the HUAWEI_VRPV8 platform enum value.
hier_config/constructors.py Registers the new platform driver in get_hconfig_driver.
hier_config/child.py Delegates sectional-exit computation to driver.sectional_exit().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@yanpla yanpla changed the title add huawei_vpv8 platform add huawei_vrpv8 platform Mar 25, 2026
Copy link
Contributor

@jtdub jtdub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @yanpla. Thank you for the contribution! I've made a couple of suggestions.

@yanpla yanpla requested a review from jtdub March 25, 2026 14:30
@yanpla yanpla changed the title add huawei_vrpv8 platform add huawei_vrp platform Mar 25, 2026
Copy link
Contributor

@jtdub jtdub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@jtdub jtdub merged commit cf05cdb into netdevops:master Mar 25, 2026
5 checks passed
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.

3 participants