Commit 114c7e2e authored by Andrey Vertiprahov's avatar Andrey Vertiprahov
Browse files

Merge branch 'noc-fix-generic' into 'master'

Generic.get_interfaces. Add method check a subinterface

See merge request !6587
parents e06ce8d7 f8598d9d
# ---------------------------------------------------------------------
# Ericsson.SEOS.get_interfaces
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# Copyright (C) 2007-2022 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
......@@ -40,3 +40,6 @@ class Script(BaseScript):
for oid, iftype in self.snmp.getnext(mib["IF-MIB::ifType"])
}
return self.INTERFACE_TYPES.get(self._iftype_map[ifindex], "other")
def is_subinterface(self, iface):
return False
# ---------------------------------------------------------------------
# Generic.get_interfaces
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# Copyright (C) 2007-2022 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
......@@ -187,6 +187,10 @@ class Script(BaseScript):
"""
return True
def is_subinterface(self, iface):
if "." in iface:
return True
def execute_snmp(self, **kwargs):
ifaces = {} # For interfaces
subifaces = {} # For subinterfaces like Fa 0/1.XXX
......@@ -202,7 +206,7 @@ class Script(BaseScript):
iface["ifindex"], iface["interface"], iface.get("oper_status")
):
continue
if "." in iface["interface"]:
if self.is_subinterface(iface["interface"]):
subifaces[iface["ifindex"]] = {
"name": iface["interface"],
"snmp_ifindex": iface["ifindex"],
......
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