aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWojciech Kosior <kwojtus@protonmail.com>2020-06-12 16:04:21 +0200
committerWojciech Kosior <kwojtus@protonmail.com>2020-06-12 16:04:21 +0200
commit3038106a16248d9d05b1545e019101e54f8291cc (patch)
treef0bac07dfaf1c0025e64f160a2cfec9e556d33c0 /src
parent4792a6816fc785300454e834c26d7320b630356d (diff)
download0tdns-3038106a16248d9d05b1545e019101e54f8291cc.tar.gz
0tdns-3038106a16248d9d05b1545e019101e54f8291cc.zip
specify query result type as a string value
Diffstat (limited to 'src')
-rwxr-xr-xsrc/perform_queries.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/perform_queries.py b/src/perform_queries.py
index 32c4edf..06dc578 100755
--- a/src/perform_queries.py
+++ b/src/perform_queries.py
@@ -58,13 +58,16 @@ def resolve_call_back(mydata, status, result):
# debugging
print("callback called for {}".format(result.qname))
if status==0 and result.havedata:
+ result_info = 'successful'
print("Result:",result.data.address_list)
+ else:
+ result_info = 'not found'
# write to database
query.cursor.execute('''
INSERT INTO user_side_responses (date, result, dns_id, service_id, vpn_id)
- VALUES (current_timestamp, '', %s, %s, %s)
+ VALUES (current_timestamp, %s, %s, %s, %s)
RETURNING id
- ''', (query.dns_id, query.service_id, query.vpn_id))
+ ''', (query.dns_id, result_info, query.service_id, query.vpn_id))
responses_id = query.cursor.fetchone()[0]