Commit 31dff4c1 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

slapos node format: timeout if we can't get our public IPv4

parent 16064cd6
...@@ -143,7 +143,7 @@ def getPublicIPv4Address(): ...@@ -143,7 +143,7 @@ def getPublicIPv4Address():
if ipv4 is not None: if ipv4 is not None:
previous = ipv4 previous = ipv4
try: try:
ipv4 = json.load(urlopen(test["url"]))[test["json_key"]] ipv4 = json.load(urlopen(test["url"], timeout=15))[test["json_key"]]
except: except:
ipv4 = None ipv4 = None
if ipv4 is not None and ipv4 == previous: if ipv4 is not None and ipv4 == previous:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment