fix(cli): the trunk gets its own row, as over REST

Since f35b59e a CLI poll reports trunk members as `3` with
trunk_group `Trk3`, but `show interfaces brief` has no line for Trk3
itself, so the trunk was missing from the interface list. The REST path
built that row on its own.

Both paths now use napalm_device_types.add_lag_interfaces, and the REST
path's copy is gone. One visible change there: `lag_members` is now in
port order (7, 10) instead of API order; the description already was.

The CLI path does not know the mode yet, so its trunks carry no
lag_mode. That needs `show trunks`, whose output is not at hand.

Needs napalm-device-types f3fa75b.

Closes #5
This commit is contained in:
Christian Manivong
2026-09-25 10:44:11 +02:00
parent f35b59ec2d
commit 7f07da6857
3 changed files with 69 additions and 18 deletions
+8 -2
View File
@@ -27,7 +27,12 @@ from netmiko.exceptions import (
NetmikoAuthenticationException,
NetmikoTimeoutException,
)
from napalm_device_types import ConfigLifecycleMixin, FingerprintRule, SwitchDriver
from napalm_device_types import (
ConfigLifecycleMixin,
FingerprintRule,
SwitchDriver,
add_lag_interfaces,
)
from napalm_device_types.models import InterfaceConfigDict, VlanConfigDict
from napalm.base import helpers as napalm_helpers
from napalm.base.exceptions import (
@@ -502,7 +507,8 @@ class ProcurveDriver(ConfigLifecycleMixin, SwitchDriver):
except Exception:
pass
return ifaces
# The CLI lists member ports only ("3-Trk3"); the trunk gets its own row.
return add_lag_interfaces(ifaces)
# ------------------------------------------------------------------
# NAPALM: get_interfaces_ip