Fallback to 'None' if no ip was resolved

This commit is contained in:
Alexandre Aubin 2018-10-24 15:55:20 +00:00
parent 6883784fdb
commit d42ac39c11

View file

@ -227,8 +227,8 @@ def dyndns_update(dyn_host="dyndns.yunohost.org", domain=None, key=None,
] ]
old_ipv4 = check_output("dig @%s +short %s" % (dyn_host, domain)).strip() old_ipv4 = check_output("dig @%s +short %s" % (dyn_host, domain)).strip() or None
old_ipv6 = check_output("dig @%s +short aaaa %s" % (dyn_host, domain)).strip() old_ipv6 = check_output("dig @%s +short aaaa %s" % (dyn_host, domain)).strip() or None
# Get current IPv4 and IPv6 # Get current IPv4 and IPv6
ipv4_ = get_public_ip() ipv4_ = get_public_ip()