base64 dns key

This commit is contained in:
Kload 2013-07-07 12:55:04 +02:00
parent 12b399c6d9
commit 94d59e4085

View file

@ -62,7 +62,8 @@ def dyndns_subscribe(subscribe_host="dyndns.yunohost.org", domain=None, key=None
# Send subscription
r = requests.post('http://'+ subscribe_host +'/key/'+ base64.b64encode(key), data={ 'subdomain': domain })
if r.status_code != 201:
error = json.loads(r.text)['error']
try: error = json.loads(r.text)['error']
except: error = "Server error"
raise YunoHostError(1, _("An error occured during DynDNS registration: "+ error))
win_msg(_("Subscribed to DynDNS"))