fix syntax error

This commit is contained in:
nd 2019-11-01 20:11:05 +01:00
parent ff7e2c1db8
commit 417d4d66a1
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9

View file

@ -19,7 +19,7 @@ def setupdb():
def get_challenge(db, path): def get_challenge(db, path):
c = db.cursor() c = db.cursor()
c.execute('SELECT value FROM challenges WHERE q = ?', (path,)) c.execute('SELECT value FROM challenges WHERE q = ?', (path,))
result = c.fetchone() result = c.fetchall()
if result: if result:
return result return result
else: else:
@ -43,7 +43,7 @@ def main_query():
stdout.write("example.com. example.example.com. 1 1d 2h 4w 1h\n") stdout.write("example.com. example.example.com. 1 1d 2h 4w 1h\n")
else: else:
for i in get_challenge(db, qname.lower()): for i in get_challenge(db, qname.lower()):
stdout.write("DATA\t" + qname + "\t" + qclass + "\tTXT\t1\t" + id + '\t"' + i + '"\n') stdout.write("DATA\t" + qname + "\t" + qclass + "\tTXT\t1\t" + id + '\t"' + i[0] + '"\n')
stdout.write("LOG\tletsencrypt pipe handler got query: '" + data + "'\n") stdout.write("LOG\tletsencrypt pipe handler got query: '" + data + "'\n")
stdout.write("END\n") stdout.write("END\n")
stdout.flush() stdout.flush()