Commit 216b01d1 authored by bee26's avatar bee26
Browse files

Merge branch 'eltex_mes_inv' into 'master'

Fix Eltex.MES.get_inventory script

See merge request !6341
parents d22a5985 ee57608e
Pipeline #36448 failed with stages
in 28 minutes and 34 seconds
......@@ -2,7 +2,7 @@
# ---------------------------------------------------------------------
# Eltex.MES.get_inventory
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# Copyright (C) 2007-2022 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
......@@ -182,17 +182,21 @@ class Script(BaseScript):
r["part_no"] = part_no
return r
def execute_cli(self, **kwargs):
res = []
ports = []
def get_optical_ports(self):
opt_ports = []
try:
v = self.cli("show fiber-ports optical-transceiver")
for i in parse_table(v, footer=r"Temp\s+- Internally measured transceiver temperature"):
if i[1] in ["OK", "N/S"] or is_int(i[1]):
ports += [i[0]]
opt_ports += [i[0]]
except self.CLISyntaxError:
pass
return opt_ports
def execute_cli(self, **kwargs):
res = []
ports = self.get_optical_ports()
if self.has_capability("Stack | Members"):
has_unit_command = True
......
......@@ -649,6 +649,8 @@ class AssetCheck(DiscoveryCheck):
# Temporary fix
if v == "D-LINK":
v = "DLINK"
if v == "48 47 20 47 45 4e 55 49 4e 45 00 00 00 00 00 00":
v = "HUAWEI"
if "INTEL" in v:
v = "INTEL"
if "FINISAR" in v:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment