{
    "name"  : "检查接口是否可以进行生成树配置优化",
    "problems" : {
        "jianyi" : {
            "desc"      : "",
            "advice"    : "【建议】该接口识别为边缘口，建议可根据实际情况（例如接口直连服务器或终端，且不存在环路）开启接口PORTFAST功能，从而减少接口UP、DOWN的收敛时间。可通过在接口下配置spanning-tree portfast开启接口的PORTFAST功能。"
        }
    }
}

---------------------------code-------------------------------
intf_name = precondition('name')
cmd = "show spanning-tree int " + intf_name
response = cli(cmd)
if response.indexOf("PortAdminPortFast : Disabled") != -1 && response.indexOf("PortOperPortFast : Enabled") != -1 && response.indexOf("PortAdminAutoEdge : Enabled") != -1 && response.indexOf("PortOperAutoEdge : Enabled") != -1 :
	sleep(8000)
	cmd = "show spanning-tree int " + intf_name
	response = cli(cmd)
	if response.indexOf("PortAdminPortFast : Disabled") != -1 && response.indexOf("PortOperPortFast : Enabled") != -1 && response.indexOf("PortAdminAutoEdge : Enabled") != -1 && response.indexOf("PortOperAutoEdge : Enabled") != -1 :
		add_problem('jianyi')
		return 'warn'
	end
end
return 'success'