mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-31 05:06:41 +00:00
style: rename ip6 addresses variable
This commit is contained in:
parent
467796b2ad
commit
dd5acae98a
|
@ -21,11 +21,11 @@ def get_ip4() -> str:
|
||||||
def get_ip6() -> Optional[str]:
|
def get_ip6() -> Optional[str]:
|
||||||
"""Get IPv6 address"""
|
"""Get IPv6 address"""
|
||||||
try:
|
try:
|
||||||
ip6 = subprocess.check_output(["ip", "addr", "show", "dev", "eth0"]).decode(
|
ip6_addresses = subprocess.check_output(["ip", "addr", "show", "dev", "eth0"]).decode(
|
||||||
"utf-8"
|
"utf-8"
|
||||||
)
|
)
|
||||||
ip6 = re.findall(r"inet6 (\S+)\/\d+", ip6)
|
ip6_addresses = re.findall(r"inet6 (\S+)\/\d+", ip6_addresses)
|
||||||
for address in ip6:
|
for address in ip6_addresses:
|
||||||
if ipaddress.IPv6Address(address).is_global:
|
if ipaddress.IPv6Address(address).is_global:
|
||||||
return address
|
return address
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
|
|
Loading…
Reference in a new issue