mpExperience/mpParamXp: add possibility to specify backup on path 1

This commit is contained in:
Quentin De Coninck 2016-06-21 17:32:19 +02:00
parent d542aa6f20
commit 63a8f60e82
2 changed files with 7 additions and 0 deletions

View File

@ -60,6 +60,11 @@ class MpExperience:
self.mpConfig.getRouterInterfaceSwitch(1) + " priority " + self.mpConfig.getRouterInterfaceSwitch(1) + " priority " +
str(prioPath1)) str(prioPath1))
backupPath1 = self.xpParam.getParam(MpParamXp.BACKUPPATH1)
if int(backupPath1) > 0:
self.mpTopo.commandTo(self.mpConfig.client, self.mpConfig.interfaceBUPCommand(self.mpConfig.getClientInterface(1)))
self.mpTopo.commandTo(self.mpConfig.router, self.mpConfig.interfaceBUPCommand(self.mpConfig.getRouterInterfaceSwitch(1)))
def runUserspacePM(self): def runUserspacePM(self):
if self.xpParam.getParam(MpParamXp.KERNELPMC) != "netlink": if self.xpParam.getParam(MpParamXp.KERNELPMC) != "netlink":
print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !") print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !")

View File

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