mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #112 from YunoHost/unreferenced_variables
Unreferenced variables
This commit is contained in:
commit
33de3c8d91
1 changed files with 2 additions and 3 deletions
|
@ -24,7 +24,6 @@
|
||||||
Subscribe and Update DynDNS Hosts
|
Subscribe and Update DynDNS Hosts
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
import requests
|
import requests
|
||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
|
@ -97,7 +96,7 @@ def dyndns_subscribe(subscribe_host="dyndns.yunohost.org", domain=None, key=None
|
||||||
# Send subscription
|
# Send subscription
|
||||||
try:
|
try:
|
||||||
r = requests.post('https://%s/key/%s' % (subscribe_host, base64.b64encode(key)), data={ 'subdomain': domain })
|
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'))
|
raise MoulinetteError(errno.ENETUNREACH, m18n.n('no_internet_connection'))
|
||||||
if r.status_code != 201:
|
if r.status_code != 201:
|
||||||
try: error = json.loads(r.text)['error']
|
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:
|
if ip is None:
|
||||||
try:
|
try:
|
||||||
new_ip = requests.get('http://ip.yunohost.org').text
|
new_ip = requests.get('http://ip.yunohost.org').text
|
||||||
except ConnectionError:
|
except requests.ConnectionError:
|
||||||
raise MoulinetteError(errno.ENETUNREACH, m18n.n('no_internet_connection'))
|
raise MoulinetteError(errno.ENETUNREACH, m18n.n('no_internet_connection'))
|
||||||
else:
|
else:
|
||||||
new_ip = ip
|
new_ip = ip
|
||||||
|
|
Loading…
Add table
Reference in a new issue