Prefer vendor label for LLDP command when it conflicts with device_type.

Huawei NEs still tagged zte_zxros were getting show lldp neighbor brief and timing out; use display lldp neighbor and align UME inventory vendor before the jump.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-29 00:24:06 +08:00
parent b36174bfa4
commit 3adf8d8b75
4 changed files with 82 additions and 18 deletions

View file

@ -157,6 +157,18 @@ class LldpParserTests(unittest.TestCase):
key, stub = lldp.parser_meta(vendor="Ericsson", device_type="ericsson_ipos")
self.assertTrue(stub)
def test_pick_command_vendor_wins_on_dtype_conflict(self) -> None:
# Stale/default zte_zxros must not force ZTE LLDP on a Huawei-labeled NE.
self.assertEqual(
lldp.pick_neighbor_command(vendor="Huawei", device_type="zte_zxros")[0],
"display lldp neighbor",
)
self.assertEqual(lldp.resolve_vendor_key("Huawei", "zte_zxros"), "huawei")
self.assertEqual(
lldp.pick_neighbor_command(vendor="Huawei", device_type="huawei")[0],
"display lldp neighbor",
)
class DeadlockHelperTests(unittest.TestCase):
def test_is_deadlock_error_detects_pg_message(self) -> None: