Commit 46857094 authored by Dmitry Lukhtionov's avatar Dmitry Lukhtionov
Browse files

Fix

parent d8d934d5
......@@ -36,20 +36,20 @@ class Script(BaseScript):
# Do not use noc.sa.profiles.Generic.get_chassis_id
def execute_snmp(self):
macs = []
macs = set()
for v in self.snmp.get(self.OIDS_CHECK).values():
if v is None:
continue
mac = MAC(v)
if mac == "00:00:00:00:00:00" or mac in macs:
continue
macs += [mac]
macs.add(mac)
for oid, v in self.snmp.getnext(mib["IF-MIB::ifPhysAddress"]):
mac = MAC(v)
if mac == "00:00:00:00:00:00" or mac in macs:
continue
macs += [mac]
macs.sort()
macs.add(mac)
macs = sorted(macs)
return [{
"first_chassis_mac": f,
"last_chassis_mac": t
......
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