summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvuko <vuko@hackerspace.pl>2021-01-11 14:54:38 +0100
committervuko <vuko@hackerspace.pl>2021-01-11 14:54:38 +0100
commita3dd788e301d30c84c8382f01f306d30dbe59da4 (patch)
treefb5529f1b82d7ff7950c43f6f84562f53facbf46
parent6780e85614ddd1c3c196d2afeb74a8612f878a34 (diff)
downloadcheckinator-a3dd788e301d30c84c8382f01f306d30dbe59da4.tar.gz
checkinator-a3dd788e301d30c84c8382f01f306d30dbe59da4.tar.bz2
checkinator-a3dd788e301d30c84c8382f01f306d30dbe59da4.zip
catch not mac based IPv6 address
-rw-r--r--at/webapp.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/at/webapp.py b/at/webapp.py
index cbb282e..3809c72 100644
--- a/at/webapp.py
+++ b/at/webapp.py
@@ -53,8 +53,12 @@ class DevicesApi:
address = ipaddress.ip_address(ip)
if isinstance(address, ipaddress.IPv6Address):
- mac = mac_from_ipv6(address)
- return ( format_mac(mac), "" )
+ try:
+ mac = mac_from_ipv6(address)
+ except ValueError:
+ pass
+ else:
+ return ( format_mac(mac), "" )
return None, None