mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #502 from YunoHost/dyndns-timeout
[fix] timeout on get_public_ip otherwish dyndns update is stucked
This commit is contained in:
commit
c2b9008bd2
1 changed files with 2 additions and 5 deletions
|
@ -21,7 +21,7 @@
|
|||
import logging
|
||||
import re
|
||||
import subprocess
|
||||
from urllib import urlopen
|
||||
from moulinette.utils.network import download_text
|
||||
|
||||
logger = logging.getLogger('yunohost.utils.network')
|
||||
|
||||
|
@ -36,10 +36,7 @@ def get_public_ip(protocol=4):
|
|||
else:
|
||||
raise ValueError("invalid protocol version")
|
||||
|
||||
try:
|
||||
return urlopen(url).read().strip()
|
||||
except IOError:
|
||||
return None
|
||||
return download_text(url, timeout=30).strip()
|
||||
|
||||
|
||||
def get_network_interfaces():
|
||||
|
|
Loading…
Add table
Reference in a new issue