From c890bffa201adae04d0eead2f6a07aeb8e1cce71 Mon Sep 17 00:00:00 2001 From: Andrey Vertiprahov Date: Sat, 13 Jun 2020 13:59:38 +0000 Subject: [PATCH] Merge branch 'fix-avs-huawei-ma5603-detect' into 'master' Huawei.MA5600T.get_inventory. Fix detect MA5603. See merge request noc/noc!3827 (cherry picked from commit ee6482d3a50a0dae33efdb598f9a59986a5198ad) ea35e605 Huawei.MA5600T.get_inventory. Fix detect MA5603. 35b95214 Fix matcher. --- .../inv.objectmodels/Huawei/SmartAX/MA5600.json | 2 +- .../inv.objectmodels/Huawei/SmartAX/MA5603.json | 2 +- sa/profiles/Huawei/MA5600T/get_inventory.py | 11 +++++++++-- sa/profiles/Huawei/MA5600T/profile.py | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/collections/inv.objectmodels/Huawei/SmartAX/MA5600.json b/collections/inv.objectmodels/Huawei/SmartAX/MA5600.json index 2e5dafeaac..e6d62d088f 100644 --- a/collections/inv.objectmodels/Huawei/SmartAX/MA5600.json +++ b/collections/inv.objectmodels/Huawei/SmartAX/MA5600.json @@ -130,7 +130,7 @@ ], "data": { "asset": { - "part_no": ["MA5600"] + "part_no": ["H511UPBA", "MA5600"] }, "dimensions": { "depth": 420, diff --git a/collections/inv.objectmodels/Huawei/SmartAX/MA5603.json b/collections/inv.objectmodels/Huawei/SmartAX/MA5603.json index 1bcf998254..e697715c50 100644 --- a/collections/inv.objectmodels/Huawei/SmartAX/MA5603.json +++ b/collections/inv.objectmodels/Huawei/SmartAX/MA5603.json @@ -67,7 +67,7 @@ ], "data": { "asset": { - "part_no": ["H511UPBA"] + "part_no": ["MA5603"] }, "dimensions": { "depth": 420, diff --git a/sa/profiles/Huawei/MA5600T/get_inventory.py b/sa/profiles/Huawei/MA5600T/get_inventory.py index b4a41d9147..1fdffd4972 100644 --- a/sa/profiles/Huawei/MA5600T/get_inventory.py +++ b/sa/profiles/Huawei/MA5600T/get_inventory.py @@ -244,14 +244,21 @@ class Script(BaseScript): if self.is_dslam: # On MA5600 chassis and subboard serial is not supported # frame = self.cli("display frame info 0") + part_no = "H511UPBA" # MA5600 + descr = "MA5600's H511UPBA backplane, with double CELLBUS and GE bus" + # Detect MA5600/MA5603 + slots, _ = self.profile.get_board(self) + if slots == 7: + part_no = "MA5603" + descr = "MA5603 subrack" r += [ { "type": "CHASSIS", "number": 0, "vendor": "Huawei", - "part_no": "H511UPBA", + "part_no": part_no, "serial": None, - "description": "MA5600's H511UPBA backplane, with double CELLBUS and GE bus", + "description": descr, } ] subboards = self.get_ma5600_subboard() diff --git a/sa/profiles/Huawei/MA5600T/profile.py b/sa/profiles/Huawei/MA5600T/profile.py index 5990e93bc5..1de5fd0577 100644 --- a/sa/profiles/Huawei/MA5600T/profile.py +++ b/sa/profiles/Huawei/MA5600T/profile.py @@ -74,7 +74,7 @@ class Profile(BaseProfile): matchers = { "is_gpon_uplink": {"platform": {"$in": ["MA5626G"]}}, - "is_dslam": {"platform": {"$in": ["MA5600"]}}, + "is_dslam": {"platform": {"$in": ["MA5600", "MA5603"]}}, "is_ua5k": {"platform": {"$in": ["UA5000", "UA5000IPMB", "UA5000PVM"]}}, "is_lldp_support": {"version": {"$gte": "V800R018C10"}}, } -- GitLab