Merge pull request #112 from YunoHost/unreferenced_variables

Unreferenced variables
This commit is contained in:
Le Kload 2015-11-01 13:20:47 +01:00
commit 33de3c8d91

View file

@ -24,7 +24,6 @@
Subscribe and Update DynDNS Hosts
"""
import os
import sys
import requests
import re
import json
@ -97,7 +96,7 @@ def dyndns_subscribe(subscribe_host="dyndns.yunohost.org", domain=None, key=None
# Send subscription
try:
r = requests.post('https://%s/key/%s' % (subscribe_host, base64.b64encode(key)), data={ 'subdomain': domain })
except ConnectionError:
except requests.ConnectionError:
raise MoulinetteError(errno.ENETUNREACH, m18n.n('no_internet_connection'))
if r.status_code != 201:
try: error = json.loads(r.text)['error']
@ -130,7 +129,7 @@ def dyndns_update(dyn_host="dynhost.yunohost.org", domain=None, key=None, ip=Non
if ip is None:
try:
new_ip = requests.get('http://ip.yunohost.org').text
except ConnectionError:
except requests.ConnectionError:
raise MoulinetteError(errno.ENETUNREACH, m18n.n('no_internet_connection'))
else:
new_ip = ip