- Included the `shutdown` command in the Huawei interface template to manage interface states. - Added a new interface configuration in `config.conf` with the `shutdown` command. - Updated the expected output JSON to reflect the new interface and its shutdown state for accurate testing and validation of configurations.
30 lines
835 B
Plaintext
30 lines
835 B
Plaintext
<doc>
|
|
Huawei VRP configuration parser.
|
|
|
|
The system group reads VRP version and slot ESN data. The interfaces group
|
|
parses interface blocks and converts dotted decimal masks to prefix lengths.
|
|
The vlans group parses `vlan batch` declarations and emits VLAN IDs.
|
|
</doc>
|
|
<vars>
|
|
default_system = {
|
|
"model": "",
|
|
"serial_number": "",
|
|
"version": ""
|
|
}
|
|
</vars>
|
|
|
|
<group name="system" default="default_system">
|
|
# VRP (R) software, Version {{ version }} ({{ model }} {{ _line_ }}
|
|
# ESN of slot {{ slot_number }}: {{ serial_number }}
|
|
</group>
|
|
|
|
<group name="interfaces">
|
|
interface {{ interface }}
|
|
description {{ description | ORPHRASE }}
|
|
shutdown {{ shutdown | set(True) }}
|
|
ip address {{ ip_address }} {{ mask | to_cidr }}
|
|
</group>
|
|
<group name="vlans">
|
|
vlan batch {{ vlan_ids | ORPHRASE | unrange(" to ", " ") | split(" ")}}
|
|
</group>
|