{
    "name"  : "地址库下一跳",
    "precondition" : [],
    "problems" : {
        "route_1" : {
            "desc"      : "【问题】地址库下一跳配置错误，接口${0}下一跳不应该配置，当前为${1}",
            "advice"    : [
                "【建议】"                
            ]
        },
        "route_2" : {
            "desc"      : "【问题】地址库下一跳配置错误，接口${0}下一跳应该是${1}，当前为${2}",
            "advice"    : [
                "【建议】"                
            ]
        }
    }
}

---------------------------code-------------------------------
isProblemFound = false

wansDetail = get_share_value('wansDetail');

datas = get_share_value('route_choose_data');
foreach data in datas:
    autoChoose = data
    autoChooseOperator = autoChoose.operator
    autoChooseIntf = autoChoose.intf
    autoChooseNexthop = autoChoose.nexthop

    foreach wan in wansDetail:
        wanOperator = wan.operator
        wanIntf = wan.intf
        wanNexthop = wan.nexthop
        if autoChooseIntf == wanIntf && wan.isUP == true:
            if autoChooseNexthop != wanNexthop :
                if wan.isDi == true && autoChooseNexthop == undefined :
                    break
                end
                isProblemFound = true
                if wan.isDi == true :
                    add_problem("route1",[wanIntf, autoChooseNexthop])
                else :
                    add_problem("route2",[wanIntf, wanNexthop ,autoChooseNexthop])
                end
            end
            break
        end
    end
end

if isProblemFound == true :
    return 'warn'
else:
    return 'success'
end
