Skip to content

Commit

Permalink
fix crash, fix "unkown" tag
Browse files Browse the repository at this point in the history
  • Loading branch information
loulecrivain committed Feb 26, 2025
1 parent 18cb19b commit 57837e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cosmo/routervisitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,10 @@ def processBgpUnnumberedTag(self, o: TagType):
parent_interface = o.getParent(InterfaceType)
opt_unnumbered_interface = {}
if parent_interface.getVRF():
loopback_interface = head(filter(
loopback_interface = head(list(filter(
lambda i: i.getName().startswith('lo') and i.getVRF() == parent_interface.getVRF(),
parent_interface.getParent(DeviceType).getInterfaces()
))
)))
opt_unnumbered_interface = {"unnumbered_interface": loopback_interface.getName()}
return {
self._interfaces_key: {
Expand Down Expand Up @@ -557,6 +557,8 @@ def _(self, o: TagType):
return self.processCoreTag(o)
case "sonderlocke":
pass # ignore, as it is treated in "core" tag handler
case "access":
pass # ignore, as it is processed in getAssociatedType()
case "unnumbered":
return self.processBgpUnnumberedTag(o)
case "bgp":
Expand Down

0 comments on commit 57837e4

Please sign in to comment.