{
    "name"  : "检查地址库的配置",
    "problems" : {
        "notAllConf" : {
            "desc"      : "【问题】${0}未开启地址库",
            "advice"    : "【建议】请确认是否需要开启接口${0}的地址库功能，如果是多运营商环境，建议开启地址库功能"
        }
    }
}

---------------------------code-------------------------------
result = get_share_value('result')
if result == 'break' || result == 'needless' :
    return 'skip'
end

isAllConf = true
noConfIntfArr = ''
response = cli('show run | include route-auto-choose')
response = response.split(/\r?\n/)
val = response[2]
if !val :
    response = ''
else :
    response = cli('show run | include route-auto-choose')
end
wan_int_info = get_share_value('wan_int_info')
foreach wan in wan_int_info:
    rep = newRegExp(wan)
    if rep.test(response) == false :
        if noConfIntfArr == '' :
            noConfIntfArr = noConfIntfArr + wan.intf
        else :
            noConfIntfArr = noConfIntfArr + ', ' + wan.intf
        end
        isAllConf = false
    end
end

if isAllConf == false :
    set_share_value('result', 'step5')
    add_problem('notAllConf', [noConfIntfArr])
    return 'warn'
end

set_share_value('result', 'step4')
return 'success'

