fix loopia acme script for new error handling
This commit is contained in:
parent
3311e2099a
commit
48a80d7e44
@ -71,14 +71,18 @@ def main():
|
|||||||
|
|
||||||
parts=[]
|
parts=[]
|
||||||
while domain:
|
while domain:
|
||||||
res = client.getSubdomains(user, pwd, domain)
|
try:
|
||||||
if 'UNKNOWN_ERROR' not in res:
|
res = client.getSubdomains(user, pwd, domain)
|
||||||
|
except xmlrpc.client.Fault as err:
|
||||||
|
if err.faultCode != 404:
|
||||||
|
raise err
|
||||||
|
else:
|
||||||
break
|
break
|
||||||
part, domain = domain.split('.', maxsplit=1)
|
part, domain = domain.split('.', maxsplit=1)
|
||||||
parts.append(part)
|
parts.append(part)
|
||||||
subdomain = '_acme-challenge.{}'.format('.'.join(parts))
|
subdomain = '_acme-challenge.{}'.format('.'.join(parts))
|
||||||
|
|
||||||
if 'UNKNOWN_ERROR' in res:
|
if not res:
|
||||||
print("Failed to find domain in loopiadns")
|
print("Failed to find domain in loopiadns")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
@ -58,14 +58,18 @@ def main():
|
|||||||
|
|
||||||
parts=[]
|
parts=[]
|
||||||
while domain:
|
while domain:
|
||||||
res = client.getSubdomains(user, pwd, domain)
|
try:
|
||||||
if 'UNKNOWN_ERROR' not in res:
|
res = client.getSubdomains(user, pwd, domain)
|
||||||
|
except xmlrpc.client.Fault as err:
|
||||||
|
if err.faultCode != 404:
|
||||||
|
raise err
|
||||||
|
else:
|
||||||
break
|
break
|
||||||
part, domain = domain.split('.', maxsplit=1)
|
part, domain = domain.split('.', maxsplit=1)
|
||||||
parts.append(part)
|
parts.append(part)
|
||||||
subdomain = '_acme-challenge.{}'.format('.'.join(parts))
|
subdomain = '_acme-challenge.{}'.format('.'.join(parts))
|
||||||
|
|
||||||
if 'UNKNOWN_ERROR' in res:
|
if not res:
|
||||||
print("Failed to find domain in loopiadns")
|
print("Failed to find domain in loopiadns")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user