Always pad mac addresses from nmap tracker with leading zeros (#23492)

pull/23578/head
Mike Miller 2019-04-30 23:43:21 +03:00 committed by Fabian Affolter
parent 75a2c057f2
commit 09012e7baa
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ def _arp(ip_address):
out, _ = arp.communicate()
match = re.search(r'(([0-9A-Fa-f]{1,2}\:){5}[0-9A-Fa-f]{1,2})', str(out))
if match:
return match.group(0)
return ':'.join([i.zfill(2) for i in match.group(0).split(':')])
_LOGGER.info('No MAC address found for %s', ip_address)
return None