mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Put request url in an intermediate variable
This commit is contained in:
parent
31105b8c86
commit
a5331063cc
1 changed files with 3 additions and 3 deletions
|
@ -183,15 +183,15 @@ def dyndns_update(dyn_host="dyndns.yunohost.org", domain=None, key=None,
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Check if domain is registered
|
# Check if domain is registered
|
||||||
if requests.get('https://{0}/test/{1}'.format(
|
request_url = 'https://{0}/test/{1}'.format(dyn_host, _domain)
|
||||||
dyn_host, _domain), timeout=30).status_code == 200:
|
if requests.get(request_url, timeout=30).status_code == 200:
|
||||||
continue
|
continue
|
||||||
except requests.ConnectionError:
|
except requests.ConnectionError:
|
||||||
raise MoulinetteError(errno.ENETUNREACH,
|
raise MoulinetteError(errno.ENETUNREACH,
|
||||||
m18n.n('no_internet_connection'))
|
m18n.n('no_internet_connection'))
|
||||||
except requests.exceptions.Timeout:
|
except requests.exceptions.Timeout:
|
||||||
logger.warning("Correction timed out on {}, skip it".format(
|
logger.warning("Correction timed out on {}, skip it".format(
|
||||||
'https://{0}/test/{1}'.format(dyn_host, _domain)))
|
request_url))
|
||||||
domain = _domain
|
domain = _domain
|
||||||
key = path
|
key = path
|
||||||
break
|
break
|
||||||
|
|
Loading…
Add table
Reference in a new issue