mpExperience/mpParamXp: allow path 0 to be backup too

This commit is contained in:
Quentin De Coninck 2016-06-21 17:35:03 +02:00
parent 63a8f60e82
commit 059fdb4d1c
2 changed files with 6 additions and 0 deletions

View File

@ -60,6 +60,10 @@ class MpExperience:
self.mpConfig.getRouterInterfaceSwitch(1) + " priority " +
str(prioPath1))
backupPath0 = self.xpParam.getParam(MpParamXp.BACKUPPATH0)
if int(backupPath0) > 0:
self.mpTopo.commandTo(self.mpConfig.client, self.mpConfig.interfaceBUPCommand(self.mpConfig.getClientInterface(0)))
self.mpTopo.commandTo(self.mpConfig.router, self.mpConfig.interfaceBUPCommand(self.mpConfig.getRouterInterfaceSwitch(0)))
backupPath1 = self.xpParam.getParam(MpParamXp.BACKUPPATH1)
if int(backupPath1) > 0:
self.mpTopo.commandTo(self.mpConfig.client, self.mpConfig.interfaceBUPCommand(self.mpConfig.getClientInterface(1)))

View File

@ -56,6 +56,7 @@ class MpParamXp(MpParam):
BURSTSOFFPACKETSSEC = "burstsOffPacketsSec"
PRIOPATH0 = "prioPath0"
PRIOPATH1 = "prioPath1"
BACKUPPATH0 = "backupPath0"
BACKUPPATH1 = "backupPath1"
EXPIRATION = "expiration"
METRIC = "metric"
@ -135,6 +136,7 @@ class MpParamXp(MpParam):
defaultValue[BURSTSOFFPACKETSSEC] = "750"
defaultValue[PRIOPATH0] = "0"
defaultValue[PRIOPATH1] = "0"
defaultValue[BACKUPPATH0] = "0"
defaultValue[BACKUPPATH1] = "0"
def __init__(self, paramFile):