]> gitweb.michael.orlitzky.com - djbdns-logparse.git/blobdiff - djbdns/dnscache.py
djbdns/{dnscache,tinydns}.py: explicit imports from djbdns.common.
[djbdns-logparse.git] / djbdns / dnscache.py
index 0d9de08592c903967ce988f355a798086661fd5d..a67060bb545ed0d57dbb5ab7da6345e9dc7a2fe3 100644 (file)
@@ -2,7 +2,7 @@
 import re
 
 from typing import Optional
-from djbdns.common import *
+from djbdns.common import convert_ip, query_type_name, timestamp_pat
 
 # The regex to match dnscache log lines.
 dnscache_log_re = re.compile(fr'({timestamp_pat}) (\w+)(.*)')
@@ -59,8 +59,8 @@ def decode_client(words : list, i : int):
 
     if len(chunks) == 3:
         # For a "query" entry's clientip:clientport:id field.
-        id = int(chunks[2], 16)
-        words[i] += f" (id {id})"
+        packet_id = int(chunks[2], 16)
+        words[i] += f" (id {packet_id})"
 
 def decode_ip(words : list, i : int):
     r"""
@@ -207,7 +207,7 @@ def decode_type(words : list, i : int):
 
     """
     qt = words[i]
-    words[i] = query_type.get(int(qt), qt)
+    words[i] = query_type_name.get(int(qt), qt)
 
 def handle_dnscache_log(line : str) -> Optional[str]:
     r"""