core: fix mishap in PublicInterface vs Interface

This commit is contained in:
Shiz 2022-01-01 14:34:46 +01:00
parent b9a1ca0063
commit 4919d1c49b
2 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ def main():
for host in interface.hosts:
print(f' @ {host.name}:')
wg_peers = {p.name: p for p in host.get_peers(interface.interface_name) or []}
for peer in find_interface_other_peers(interface):
for peer in find_interface_other_peers(interface.to_public()):
if peer.interface.public_key not in wg_peers:
print(f' {peer.name}: expected but not found')
success = False

View File

@ -393,7 +393,7 @@ class WeegeePeer(WeegeeBase):
@classmethod
def find_for_interfaces(cls, ctx: WeegeeContext, interfaces: set[WeegeePublicInterface]) -> set['WeegeePeer']:
return set(p for p in cls.find_all(ctx) if p.interface in interfaces)
return set(p for p in cls.find_all(ctx) if p.interface.to_public() in interfaces)
@classmethod
def create(cls, ctx: WeegeeContext, name: str, interface: WeegeePublicInterface, routes: list[IPNetwork], host: O[str] = None, port: O[int] = None, extra: O[list[str]] = None) -> 'WeegeePeer':