extra check in case mac lookup fails
@@ -10,13 +10,14 @@ def get_ether_vendor(mac, lookup_path):
"""
Takes a MAC address and looks up and returns the vendor for it.
"""
- vendor = 'UNDEFINED'
mac = ''.join(mac.split(':'))[:6].upper()
+ try:
with open(lookup_path, 'r') as f:
for line in f:
if line.startswith(mac):
return line.split()[1].strip()
- return vendor
+ except Exception as e: # pragma: no cover
+ return 'UNDEFINED'
def get_rdns_lookup(ip):
