use popen

This commit is contained in:
rootzoll
2020-07-14 17:52:21 +02:00
parent 9871c32faf
commit 94e386ae6a

View File

@@ -109,10 +109,11 @@ def subscriptionsNew(ip, dnsservice, id, token, target):
duckDNSupdate(getsubdomain(id), token, realip) duckDNSupdate(getsubdomain(id), token, realip)
# run the ACME script # run the ACME script
acmeResult=subprocess.check_output(["/home/admin/config.scripts/bonus.letsencrypt.sh", "issue-cert", dnsservice, id, token, target]) acmeResult=subprocess.Popen(["/home/admin/config.scripts/bonus.letsencrypt.sh", "issue-cert", dnsservice, id, token, target], stdout=subprocess.PIPE)
if acmeResult != 0: out, err = acmeResult.communicate()
time.sleep(6) if out.find("error=") > -1:
raise BlitzError("letsancrypt acme failed", acmeResult) time.sleep(6)
raise BlitzError("letsancrypt acme failed", out)
# create subscription data for storage # create subscription data for storage
subscription = {} subscription = {}
@@ -170,7 +171,7 @@ def subscriptionsCancel(id):
out, err = acmeResult.communicate() out, err = acmeResult.communicate()
if out.find("error=") > -1: if out.find("error=") > -1:
time.sleep(6) time.sleep(6)
raise BlitzError("letsancrypt acme failed", acmeResult) raise BlitzError("letsancrypt acme failed", out)
# persist change # persist change
with open(SUBSCRIPTIONS_FILE, 'w') as writer: with open(SUBSCRIPTIONS_FILE, 'w') as writer: