mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
Services: Kea DHCP [new]: Leases DHCPv4 - deduplicate records. apparantly kea leases from memory can be duplicated (see also https://gitlab.isc.org/isc-projects/kea/-/issues/2293), use the first two fields (ip+mac) to deduplicate them. closes https://github.com/opnsense/core/issues/7136
This commit is contained in:
parent
b407f5e81a
commit
41b3881a73
@ -51,11 +51,14 @@ if __name__ == '__main__':
|
||||
|
||||
result = {'records': []}
|
||||
header = None
|
||||
dedup_keys = set()
|
||||
with open(filename, 'r') as csvfile:
|
||||
for idx, record in enumerate(csv.reader(csvfile, delimiter=',', quotechar='"')):
|
||||
rec_key = ','.join(record[:2])
|
||||
if idx == 0:
|
||||
header = record
|
||||
elif header:
|
||||
elif header and rec_key not in dedup_keys:
|
||||
dedup_keys.add(rec_key)
|
||||
named_record = {'if': None}
|
||||
for findx, field in enumerate(record):
|
||||
if findx < len(header):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user