diff --git a/ennstatus/api/functions.py b/ennstatus/api/functions.py --- a/ennstatus/api/functions.py +++ b/ennstatus/api/functions.py @@ -63,7 +63,7 @@ def check_json_format(server): if any([address.is_private, address.is_multicast, address.is_unspecified, address.is_reserved, - address.is_loopback, address.link_local]): + address.is_loopback]): raise ValueError('ip is not accepted!\n') except ipaddress.AddressValueError: @@ -74,11 +74,11 @@ def check_json_format(server): address = ipaddress.IPv6Address(server['ip6']) if any([address.is_private, address.is_multicast, address.is_unspecified, address.is_reserved, - address.is_loopback, address.link_local]): - raise ValueError('ip is not accepted!\n') + address.is_loopback]): + raise ValueError('ip6 is not accepted!\n') except ipaddress.AddressValueError: - raise ValueError('ip is not the right format!\n') + raise ValueError('ip6 is not the right format!\n') return True @@ -98,7 +98,7 @@ def update_server(server, ip): if ip.version == 4: server['country'] = gi4.country_name_by_addr(str(ip)) - elif ip.verion == 6: + elif ip.version == 6: server['country'] = gi6.country_name_by_addr(str(ip)) server_name = server['server_name']