[backend] change default values in Peeringmanager.exists()

the large if clause there would return false if the requested peering doesn't have bgp_mp and bgp_enh
This commit is contained in:
lare 2024-09-01 14:25:08 +02:00
parent e8673e77c7
commit 8a50244209

View file

@ -117,7 +117,7 @@ class PeeringManager:
except KeyError: except KeyError:
return 0 return 0
def exists(self, asn, node, mnt=None, wg_key=None, endpoint=None, ipv6ll=None, ipv4=None, ipv6=None, bgp_mp=True, bgp_enh=True): def exists(self, asn, node, mnt=None, wg_key=None, endpoint=None, ipv6ll=None, ipv4=None, ipv6=None, bgp_mp=None, bgp_enh=None):
"""checks if a peerings with specific data already exists""" """checks if a peerings with specific data already exists"""
# check if mnt is specified, already exists in the database and if that mnt has the specified ASn -> if not: return False # check if mnt is specified, already exists in the database and if that mnt has the specified ASn -> if not: return False
if mnt and not (mnt in self.peerings["mntner"] and asn in self.peerings["mntner"][mnt]): if mnt and not (mnt in self.peerings["mntner"] and asn in self.peerings["mntner"][mnt]):