{
    "name"  : "源进源出",
    "precondition" : [],
    "problems" : {
        "port" : {
            "desc"      : "【问题】接口${0}未配置源进源出功能",
            "advice"    : ["【建议】可运行如下配置进行配置", 
                           "配置示例：",
                           "\tRuijie#config",
                           "\tRuijie(config)#interface ${1}",
                           "\tRuijie(config-if)#reverse-path",
                           "\tRuijie(config-if)#end",
                           "\tRuijie#write"]
        }
    }
}

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

wansDetail = get_share_value('wansDetail');
isMultiOutIntf = false

num = 0
foreach wan in wansDetail:
    if wan.isUP && wan.ip :
        num = num + 1
        if num == 2:
            isMultiOutIntf = true
            break   
        end
        
    end
end

set_share_value('isMultiOutIntf', isMultiOutIntf)


foreach wan in wansDetail:  
    intf = wan.intf
    if wan.isUP && wan.ip && !wan.reverse && isMultiOutIntf :
        isProblemFound = true
        add_problem("port",[intf,intf])
    end
end


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

