self.links = {}
self.linkn = 0
+ def __str__(self):
+ links = ''
+ for myif, dest in self.links.iteritems():
+ _, destif = dest
+ if links != '':
+ links += ','
+ links += '"{}"<->"{}"'.format(myif, destif)
+
+ return 'TopoGear<name="{}",links=[{}]>'.format(self.name, links)
+
def run(self, command):
"""
Runs the provided command string in the router and returns a string
]
# Router Daemon enumeration definition.
- RD_ZEBRA = 1,
+ RD_ZEBRA = 1
RD_RIP = 2
RD_RIPNG = 3
RD_OSPF = 4
params['privateDirs'] = self.PRIVATE_DIRS
self.tgen.topo.addNode(self.name, cls=self.cls, **params)
+ def __str__(self):
+ gear = super(TopoRouter, self).__str__()
+ gear += ' TopoRouter<>'
+ return gear
+
def load_config(self, daemon, source=None):
"""
Loads daemon configuration from the specified source
self.name = name
self.cls = cls
self.tgen.topo.addSwitch(name, cls=self.cls)
+
+ def __str__(self):
+ gear = super(TopoSwitch, self).__str__()
+ gear += ' TopoSwitch<>'
+ return gear