bundles/wireguard: rework metadata.py
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit

This commit is contained in:
Franzi 2021-04-01 16:27:31 +02:00
parent b679f568eb
commit 6e423c24fb
Signed by: kunsi
GPG key ID: 12E3D2136B818350
7 changed files with 155 additions and 64 deletions

View file

@ -55,3 +55,26 @@ def resolve_identifier(repo, identifier):
ip_dict['ipv6'].add(ip)
return ip_dict
def remove_more_specific_subnets(input_subnets) -> list:
final_subnets = []
for subnet in sorted(input_subnets):
source = ip_network(subnet)
if not source in final_subnets:
subnet_found = False
for dest_subnet in final_subnets:
if source.subnet_of(dest_subnet):
subnet_found = True
if not subnet_found:
final_subnets.append(source)
out = []
for net in final_subnets:
out.append(str(net))
return out