bw 13 hashable
This commit is contained in:
parent
b022eabeb0
commit
34e9366c61
3 changed files with 8 additions and 10 deletions
|
@ -136,8 +136,7 @@ for view in views:
|
|||
],
|
||||
}
|
||||
|
||||
for zone, record_dicts in zones.items():
|
||||
records = record_dicts.values()
|
||||
for zone, records in zones.items():
|
||||
unique_records = [
|
||||
dict(record_tuple)
|
||||
for record_tuple in set(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from ipaddress import ip_interface
|
||||
from json import dumps
|
||||
|
||||
h = repo.libs.hashable.hashable
|
||||
|
||||
defaults = {
|
||||
'apt': {
|
||||
|
@ -75,12 +75,11 @@ def collect_records(metadata):
|
|||
|
||||
for type, values in records.items():
|
||||
for value in values:
|
||||
entry = {'name': name, 'type': type, 'value': value}
|
||||
zones\
|
||||
.setdefault(zone, {})\
|
||||
.update({
|
||||
str(hash(dumps(entry))): entry,
|
||||
})
|
||||
.setdefault(zone, set())\
|
||||
.add(
|
||||
h({'name': name, 'type': type, 'value': value})
|
||||
)
|
||||
|
||||
return {
|
||||
'bind': {
|
||||
|
@ -108,7 +107,7 @@ def ns_records(metadata):
|
|||
'zones': {
|
||||
zone: {
|
||||
# FIXME: bw currently cant handle lists of dicts :(
|
||||
str(hash(dumps({'name': '@', 'type': 'NS', 'value': f"{nameserver}."}))): {'name': '@', 'type': 'NS', 'value': f"{nameserver}."}
|
||||
h({'name': '@', 'type': 'NS', 'value': f"{nameserver}."})
|
||||
for nameserver in nameservers
|
||||
} for zone in metadata.get('bind/zones').keys()
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
bundlewrap>=4.12.0
|
||||
bundlewrap>=4.13.0
|
||||
pycryptodome
|
||||
PyNaCl
|
||||
PyYAML
|
||||
|
|
Loading…
Reference in a new issue