From 5c1b9cfe235fb76e74749b11e3be09025d4855bf Mon Sep 17 00:00:00 2001 From: Quentin De Coninck Date: Mon, 12 Jun 2017 09:53:30 +0200 Subject: [PATCH] Fixing too long names + typos --- src/mpMultiInterfaceCongConfig.py | 6 +++--- src/mpMultiInterfaceCongTopo.py | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mpMultiInterfaceCongConfig.py b/src/mpMultiInterfaceCongConfig.py index 182146c..160b39b 100644 --- a/src/mpMultiInterfaceCongConfig.py +++ b/src/mpMultiInterfaceCongConfig.py @@ -1,5 +1,5 @@ from mpConfig import MpConfig -from mpMultiInterfaceTopo import MpMultiInterfaceTopo +from mpMultiInterfaceCongTopo import MpMultiInterfaceCongTopo from mpParamTopo import MpParamTopo from mpTopo import MpTopo @@ -176,7 +176,7 @@ class MpMultiInterfaceCongConfig(MpConfig): return MpTopo.clientName + "-eth" + str(interfaceID) def getCongClientInterface(self, interfaceID): - return "CongClient-" + str(interfaceID) + "-eth0" + return MpMultiInterfaceCongTopo.congClientName + "-" + str(interfaceID) + "-eth0" def getRouterInterfaceSwitch(self, interfaceID): return MpTopo.routerName + "-eth" + str(interfaceID) @@ -185,7 +185,7 @@ class MpMultiInterfaceCongConfig(MpConfig): return MpTopo.serverName + "-eth0" def getCongServerInterface(self, interfaceID): - return "CongServer-" + str(interfaceID) + "-eth0" + return MpMultiInterfaceCongTopo.congServerName + "-" + str(interfaceID) + "-eth0" def getMidLeftName(self, id): return MpTopo.switchNamePrefix + str(id) diff --git a/src/mpMultiInterfaceCongTopo.py b/src/mpMultiInterfaceCongTopo.py index ce22520..ccd5853 100644 --- a/src/mpMultiInterfaceCongTopo.py +++ b/src/mpMultiInterfaceCongTopo.py @@ -1,6 +1,9 @@ from mpTopo import MpTopo class MpMultiInterfaceCongTopo(MpTopo): + congClientName = "CCli" + congServerName = "CSer" + def __init__(self, topoBuilder, parameterFile): MpTopo.__init__(self,topoBuilder, parameterFile) print("Hello from topo multi if") @@ -13,12 +16,12 @@ class MpMultiInterfaceCongTopo(MpTopo): for l in self.topoParam.linkCharacteristics: self.switch.append(self.addOneSwitchPerLink(l)) self.addLink(self.client,self.switch[-1]) - self.cong_clients.append(self.addHost("CongClient-" + str(len(self.cong_clients)))) + self.cong_clients.append(self.addHost(MpMultiInterfaceCongTopo.congClientName + "-" + str(len(self.cong_clients)))) self.addLink(self.cong_clients[-1], self.switch[-1]) self.addLink(self.switch[-1],self.router, **l.asDict()) self.addLink(self.router, self.server) for i in range(len(self.cong_clients)): - self.cong_servers.append(self.addHost("CongServer-" + str(len(self.cong_servers)))) + self.cong_servers.append(self.addHost(MpMultiInterfaceCongTopo.congServerName + "-" + str(len(self.cong_servers)))) self.addLink(self.router, self.cong_servers[-1]) def getCongClients(self):