def routerConfig(
obj, deviceType, prompt, timeout, protocol, asNum, routerArg1,
routerArg2, routerArg3, routerArg4, routerArg5, routerArg6, routerArg7,
routerArg8):
retVal = ""
# Wait time to get response from server
timeout = timeout
if(protocol == "bgp"):
# bgp config command happens here.
command = "routing-protocol bgp "
value = checkSanityofVariable(deviceType, "bgp_as_number", asNum)
if(value == "ok"):
# BGP command happens here. It creates if not present
command = command + asNum + "\n"
# debugOutput(command)
retVal = waitForDeviceResponse(
command, "(config-router)#", timeout, obj)
retVal = retVal + bgpConfig(
obj, deviceType, "(config-router)#", timeout, routerArg1,
routerArg2, routerArg3, routerArg4, routerArg5, routerArg6,
routerArg7, routerArg8)
else:
retVal = "Error-176"
elif(protocol == "ospf"):
retVal = "Command Value is Not supported as of now"
else:
retVal = "Error-177"
return retVal
# EOM
评论列表
文章目录