cnos.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:ansible-provider-docs 作者: alibaba 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号