Make get_snmp_data more robust (#6798)
parent
be04ef7be1
commit
a70af62e60
|
@ -125,7 +125,10 @@ class SnmpScanner(DeviceScanner):
|
|||
|
||||
for resrow in restable:
|
||||
for _, val in resrow:
|
||||
mac = binascii.hexlify(val.asOctets()).decode('utf-8')
|
||||
try:
|
||||
mac = binascii.hexlify(val.asOctets()).decode('utf-8')
|
||||
except AttributeError:
|
||||
continue
|
||||
_LOGGER.debug("Found MAC %s", mac)
|
||||
mac = ':'.join([mac[i:i+2] for i in range(0, len(mac), 2)])
|
||||
devices.append({'mac': mac})
|
||||
|
|
Loading…
Reference in New Issue