ignore comments
This commit is contained in:
parent
5f312f96ab
commit
be5a6fde60
@ -61,10 +61,11 @@ def get_addr_maps(
|
|||||||
while len(lines) > 0 and not lines[0].startswith("[Peer]"):
|
while len(lines) > 0 and not lines[0].startswith("[Peer]"):
|
||||||
# If this is an allowed ip line, parse it
|
# If this is an allowed ip line, parse it
|
||||||
if lines[0].startswith("AllowedIPs"):
|
if lines[0].startswith("AllowedIPs"):
|
||||||
|
allowed_ips_line = lines[0].split("#")[0]
|
||||||
allowed_ips.extend(
|
allowed_ips.extend(
|
||||||
[
|
[
|
||||||
ipaddress.ip_network(addr.strip())
|
ipaddress.ip_network(addr.strip())
|
||||||
for addr in (lines[0].split("=")[1].strip()).split(",")
|
for addr in (allowed_ips_line.split("=")[1].strip()).split(",")
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user