{
    "name"  : "wan口带宽",
    "precondition" : [],
    "problems" : {
        "port_bandwidth" : {
            "desc"      : "【问题】接口${0}没有配置带宽，请确认该接口的带宽值是不是 ${1} Mb，不是请修改",
            "advice"    : "【建议】带宽如果不符合，请按照以下方式修订：接口下模式下配置bandwidth 或者web界面：网络配置->接口配置->点击接口配置下行带宽"
        }
    }
}

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

wansDetail = get_share_value('wansDetail');

hasBandWidth = true

foreach wan in wansDetail:
    #print wan.isUP
    #print wan.ip
    if !wan.isUP || !wan.ip :
        #print 'xxxxxxxxxxxxxxxxxxxxxxxxx'
        continue
    end
    if !wan.cfgBandWidth :
        print '-------------------'
        hasBandWidth = false;
        isProblemFound = true
        intf = wan.intf
        str = wan.bandWidth / 1000
        add_problem("port_bandwidth",[intf,str])
    end
end


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