Commit b3053e79 authored by Franco Fichtner's avatar Franco Fichtner

interfaces: finish up arp and ndp

o Order dependencies alphabetically in Makefile
o Use try/except so that failed lookup won't trash the script run
parent a619d5cc
......@@ -94,10 +94,10 @@ CORE_DEPENDS?= apinger \
php56-xml \
php56-zlib \
py27-Jinja2 \
py27-netaddr \
py27-requests \
py27-sqlite3 \
py27-ujson \
py27-netaddr \
python27 \
radvd \
rate \
......
......@@ -34,7 +34,7 @@ import os
import os.path
import sys
import ujson
from netaddr import *
import netaddr
if __name__ == '__main__':
result = []
......@@ -64,10 +64,11 @@ if __name__ == '__main__':
'manufacturer': '',
'hostname': ''
}
manufacturer_mac = EUI(record['mac'])
oui = manufacturer_mac.oui
if oui.registration().org:
record['manufacturer'] = oui.registration().org
manufacturer_mac = netaddr.EUI(record['mac'])
try:
record['manufacturer'] = manufacturer_mac.oui.registration().org
except netaddr.NotRegisteredError:
pass
if record['ip'] in dhcp_leases:
record['hostname'] = dhcp_leases[record['ip']]['hostname']
result.append(record)
......
......@@ -34,7 +34,7 @@ import os
import os.path
import sys
import ujson
from netaddr import *
import netaddr
if __name__ == '__main__':
result = []
......@@ -52,10 +52,11 @@ if __name__ == '__main__':
'intf': line_parts[2],
'manufacturer': ''
}
manufacturer_mac = EUI(record['mac'])
oui = manufacturer_mac.oui
if oui.registration().org:
record['manufacturer'] = oui.registration().org
manufacturer_mac = netaddr.EUI(record['mac'])
try:
record['manufacturer'] = manufacturer_mac.oui.registration().org
except netaddr.NotRegisteredError:
pass
result.append(record)
# handle command line argument (type selection)
......
Markdown is supported
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