stay compatible with Python2
This commit is contained in:
parent
e5042cc296
commit
d37f6d6405
@ -1,7 +1,7 @@
|
|||||||
from .parameter import ExperienceParameter
|
from .parameter import ExperienceParameter
|
||||||
from mpMultiInterfaceTopo import MpMultiInterfaceTopo
|
from mpMultiInterfaceTopo import MpMultiInterfaceTopo
|
||||||
|
|
||||||
class Experience:
|
class Experience(object):
|
||||||
PING = "ping"
|
PING = "ping"
|
||||||
NCPV = "ncpv"
|
NCPV = "ncpv"
|
||||||
NC = "nc"
|
NC = "nc"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
class Parameter:
|
class Parameter(object):
|
||||||
def __init__(self, paramFile):
|
def __init__(self, paramFile):
|
||||||
self.paramDic = {}
|
self.paramDic = {}
|
||||||
print("Create the param Object")
|
print("Create the param Object")
|
||||||
@ -208,10 +208,10 @@ class ExperienceParameter(Parameter):
|
|||||||
defaultValue[BACKUPPATH1] = "0"
|
defaultValue[BACKUPPATH1] = "0"
|
||||||
|
|
||||||
def __init__(self, paramFile):
|
def __init__(self, paramFile):
|
||||||
super().__init__(paramFile)
|
super(ExperienceParameter, self).__init__(paramFile)
|
||||||
|
|
||||||
def getParam(self, key):
|
def getParam(self, key):
|
||||||
val = super().getParam(key)
|
val = super(ExperienceParameter, self).getParam(key)
|
||||||
if val is None:
|
if val is None:
|
||||||
if key in ExperienceParameter.defaultValue:
|
if key in ExperienceParameter.defaultValue:
|
||||||
return ExperienceParameter.defaultValue[key]
|
return ExperienceParameter.defaultValue[key]
|
||||||
|
@ -89,7 +89,7 @@ class TopoParameter(Parameter):
|
|||||||
s = s + self.linkCharacteristics[-1].__str__()
|
s = s + self.linkCharacteristics[-1].__str__()
|
||||||
return s
|
return s
|
||||||
|
|
||||||
class Topo:
|
class Topo(object):
|
||||||
mininetBuilder = "mininet"
|
mininetBuilder = "mininet"
|
||||||
multiIfTopo = "MultiIf"
|
multiIfTopo = "MultiIf"
|
||||||
ECMPLikeTopo = "ECMPLike"
|
ECMPLikeTopo = "ECMPLike"
|
||||||
@ -149,7 +149,7 @@ class Topo:
|
|||||||
self.topoBuilder.stopNetwork()
|
self.topoBuilder.stopNetwork()
|
||||||
|
|
||||||
|
|
||||||
class TopoConfig:
|
class TopoConfig(object):
|
||||||
|
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ from struct import *
|
|||||||
|
|
||||||
class MpECMPSingleInterfaceConfig(TopoConfig):
|
class MpECMPSingleInterfaceConfig(TopoConfig):
|
||||||
def __init__(self, topo, param):
|
def __init__(self, topo, param):
|
||||||
super().__init__(topo, param)
|
super(MpECMPSingleInterfaceConfig, self).__init__(topo, param)
|
||||||
|
|
||||||
def configureRoute(self):
|
def configureRoute(self):
|
||||||
i = 0
|
i = 0
|
||||||
|
@ -2,7 +2,7 @@ from core.topo import Topo
|
|||||||
|
|
||||||
class MpECMPSingleInterfaceTopo(Topo):
|
class MpECMPSingleInterfaceTopo(Topo):
|
||||||
def __init__(self, topoBuilder, parameterFile):
|
def __init__(self, topoBuilder, parameterFile):
|
||||||
super().__init__(topoBuilder, parameterFile)
|
super(MpECMPSingleInterfaceTopo, self).__init__(topoBuilder, parameterFile)
|
||||||
|
|
||||||
print("Hello ECMP topo")
|
print("Hello ECMP topo")
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ from mpMultiInterfaceTopo import MpMultiInterfaceTopo
|
|||||||
|
|
||||||
class MpMultiInterfaceConfig(TopoConfig):
|
class MpMultiInterfaceConfig(TopoConfig):
|
||||||
def __init__(self, topo, param):
|
def __init__(self, topo, param):
|
||||||
super().__init__(topo, param)
|
super(MpMultiInterfaceConfig, self).__init__(topo, param)
|
||||||
|
|
||||||
def configureRoute(self):
|
def configureRoute(self):
|
||||||
i = 0
|
i = 0
|
||||||
|
@ -3,7 +3,7 @@ from core.topo import TopoConfig, Topo, TopoParameter
|
|||||||
|
|
||||||
class MpMultiInterfaceCongConfig(TopoConfig):
|
class MpMultiInterfaceCongConfig(TopoConfig):
|
||||||
def __init__(self, topo, param):
|
def __init__(self, topo, param):
|
||||||
super().__init__(topo, param)
|
super(MpMultiInterfaceCongConfig, self).__init__(topo, param)
|
||||||
|
|
||||||
def configureRoute(self):
|
def configureRoute(self):
|
||||||
i = 0
|
i = 0
|
||||||
|
@ -5,7 +5,7 @@ class MpMultiInterfaceCongTopo(Topo):
|
|||||||
congServerName = "CSer"
|
congServerName = "CSer"
|
||||||
|
|
||||||
def __init__(self, topoBuilder, parameterFile):
|
def __init__(self, topoBuilder, parameterFile):
|
||||||
super().__init__(topoBuilder, parameterFile)
|
super(MpMultiInterfaceCongTopo, self).__init__(topoBuilder, parameterFile)
|
||||||
print("Hello from topo multi if")
|
print("Hello from topo multi if")
|
||||||
self.client = self.addHost(Topo.clientName)
|
self.client = self.addHost(Topo.clientName)
|
||||||
self.server = self.addHost(Topo.serverName)
|
self.server = self.addHost(Topo.serverName)
|
||||||
|
@ -2,7 +2,7 @@ from core.topo import Topo
|
|||||||
|
|
||||||
class MpMultiInterfaceTopo(Topo):
|
class MpMultiInterfaceTopo(Topo):
|
||||||
def __init__(self, topoBuilder, parameterFile):
|
def __init__(self, topoBuilder, parameterFile):
|
||||||
super().__init__(topoBuilder, parameterFile)
|
super(MpMultiInterfaceTopo, self).__init__(topoBuilder, parameterFile)
|
||||||
print("Hello from topo multi if")
|
print("Hello from topo multi if")
|
||||||
self.client = self.addHost(Topo.clientName)
|
self.client = self.addHost(Topo.clientName)
|
||||||
self.server = self.addHost(Topo.serverName)
|
self.server = self.addHost(Topo.serverName)
|
||||||
|
@ -3,7 +3,7 @@ from mpTwoInterfaceCongestionTopo import MpTwoInterfaceCongestionTopo
|
|||||||
|
|
||||||
class MpTwoInterfaceCongestionConfig(TopoConfig):
|
class MpTwoInterfaceCongestionConfig(TopoConfig):
|
||||||
def __init__(self, topo, param):
|
def __init__(self, topo, param):
|
||||||
super().__init__(topo, param)
|
super(MpTwoInterfaceCongestionConfig, self).__init__(topo, param)
|
||||||
|
|
||||||
def configureRoute(self):
|
def configureRoute(self):
|
||||||
# Client - Router
|
# Client - Router
|
||||||
|
@ -2,7 +2,7 @@ from core.topo import Topo
|
|||||||
|
|
||||||
class MpTwoInterfaceCongestionTopo(Topo):
|
class MpTwoInterfaceCongestionTopo(Topo):
|
||||||
def __init__(self, topoBuilder, parameterFile):
|
def __init__(self, topoBuilder, parameterFile):
|
||||||
super().__init__(topoBuilder, parameterFile)
|
super(MpTwoInterfaceCongestionTopo, self).__init__(topoBuilder, parameterFile)
|
||||||
|
|
||||||
print("Hello from topo two ifs cong")
|
print("Hello from topo two ifs cong")
|
||||||
print("Expected topo:")
|
print("Expected topo:")
|
||||||
|
Loading…
Reference in New Issue
Block a user