Commit 62046922 authored by Petr Špaček's avatar Petr Špaček

zone2pickle: fix typing after migration to FrozenSet

parent 2dfed7f0
......@@ -9,7 +9,7 @@ import ipaddress
import logging
import pickle
import sys
from typing import Dict, List, Iterable, Set, TextIO, Tuple
from typing import Dict, FrozenSet, List, Iterable, Set, TextIO, Tuple
import dns.zone
......@@ -32,11 +32,11 @@ class ZoneExtractor():
# zone
self.origin = dns.name.from_text(owner_str)
self.nsnames = set() # type: Set[dns.name.Name]
self.nsname2ipset = {} # type: Dict[dns.name.Name, Set[AnIPAddress]]
self.domain2nsset = {} # type: Dict[dns.name.Name, Set[dns.name.Name]]
self.nsname2ipset = {} # type: Dict[dns.name.Name, FrozenSet[AnIPAddress]]
self.domain2nsset = {} # type: Dict[dns.name.Name, FrozenSet[dns.name.Name]]
# data deduplication: temporary dict for singletons
self.nssets = {} # type: Dict[Set[dns.name.Name], Set[dns.name.Name]]
self.nssets = {} # type: Dict[FrozenSet[dns.name.Name], FrozenSet[dns.name.Name]]
self.names = NameCache() # type: Dict[str, dns.name.Name]
# reader
......@@ -89,9 +89,9 @@ def _read_soa(zone_file: TextIO) -> str:
return owner
def convert(zone_file: TextIO, zone_origin: dns.name.Name) -> Tuple[ \
Dict[dns.name.Name, Set[dns.name.Name]], \
Dict[dns.name.Name, FrozenSet[dns.name.Name]], \
Set[dns.name.Name], \
Dict[dns.name.Name, Set[AnIPAddress]]]:
Dict[dns.name.Name, FrozenSet[AnIPAddress]]]:
'''
convert text zone into set of pickle files with preprocessed metadata
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment