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

zone2pickle: fix typing after migration to FrozenSet

parent d6779e8f
Pipeline #48081 passed with stage
in 1 minute and 12 seconds
...@@ -9,7 +9,7 @@ import ipaddress ...@@ -9,7 +9,7 @@ import ipaddress
import logging import logging
import pickle import pickle
import sys import sys
from typing import Dict, List, Iterable, Set, TextIO, Tuple from typing import Dict, FrozenSet, List, Iterable, Set, TextIO, Tuple
import dns.zone import dns.zone
...@@ -32,11 +32,11 @@ class ZoneExtractor(): ...@@ -32,11 +32,11 @@ class ZoneExtractor():
# zone # zone
self.origin = dns.name.from_text(owner_str) self.origin = dns.name.from_text(owner_str)
self.nsnames = set() # type: Set[dns.name.Name] self.nsnames = set() # type: Set[dns.name.Name]
self.nsname2ipset = {} # type: Dict[dns.name.Name, Set[AnIPAddress]] self.nsname2ipset = {} # type: Dict[dns.name.Name, FrozenSet[AnIPAddress]]
self.domain2nsset = {} # type: Dict[dns.name.Name, Set[dns.name.Name]] self.domain2nsset = {} # type: Dict[dns.name.Name, FrozenSet[dns.name.Name]]
# data deduplication: temporary dict for singletons # 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] self.names = NameCache() # type: Dict[str, dns.name.Name]
# reader # reader
...@@ -89,9 +89,9 @@ def _read_soa(zone_file: TextIO) -> str: ...@@ -89,9 +89,9 @@ def _read_soa(zone_file: TextIO) -> str:
return owner return owner
def convert(zone_file: TextIO, zone_origin: dns.name.Name) -> Tuple[ \ 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], \ 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 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