Commit b7780ff5 authored by MaksimSmile13's avatar MaksimSmile13
Browse files

Fix Generic. Add method check a subinterface

parent e06ce8d7
Pipeline #37254 passed with stages
in 15 minutes and 51 seconds
# ---------------------------------------------------------------------
# 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