{
    "name"  : "地址库运营商属性",
    "precondition" : [],
    "problems" : {
        "route" : {
            "desc"      : "【问题】接口${0}线路应该是属于${1}运营商，当前运营商是${2}地址库配置运营商错误",
            "advice"    : [
                "【建议】"                
            ]
        }
    }
}

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

wansDetail = get_share_value('wansDetail');

res = cli("show run | include route-auto-choose")
datas = formatRouteAutoChoose(res)
set_share_value('route_choose_data', datas)
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 autoChooseOperator != wanOperator :
                isProblemFound = true
                str = getOperatorText(wanOperator)
                str1 = getOperatorText(autoChooseOperator)
                add_problem("route",[wanIntf,str ,str1 ])
            end
            break
        end
    end
end

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