Skip to content

Commit bc4fb89

Browse files
committedMar 19, 2025·
feat: Implement breakouts
1 parent 5657420 commit bc4fb89

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

‎cosmo/routervisitor.py

+16
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,20 @@ def processDhcpTag(self, o: TagType):
555555
}
556556
}
557557

558+
def processBreakoutTag(self, o: TagType):
559+
interface = o.getParent(InterfaceType)
560+
561+
if interface.isSubInterface():
562+
warnings.warn(f"Interface {interface.getName()} is a sub-interface, breakout tag needs to be set on parent interface.")
563+
564+
return {
565+
self._interfaces_key: {
566+
**interface.spitInterfacePathWith({
567+
"breakout": o.getTagValue(),
568+
})
569+
}
570+
}
571+
558572
def processBgpUnnumberedTag(self, o: TagType):
559573
parent_interface = o.getParent(InterfaceType)
560574
opt_unnumbered_interface = {}
@@ -602,6 +616,8 @@ def _(self, o: TagType):
602616
return self.processEdgeTag(o)
603617
case "core":
604618
return self.processCoreTag(o)
619+
case "breakout":
620+
return self.processBreakoutTag(o)
605621
case "sonderlocke":
606622
pass # ignore, as it is treated in "core" tag handler
607623
case "access":

0 commit comments

Comments
 (0)
Please sign in to comment.