Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix TypeError: 'list' object is not an iterator for test_cacl_applica…
…tion (sonic-net#9022) What is the motivation for this PR? test_cacl_application failed on dualtor testbed due to TypeError: 'list' object is not an iterator. That's because the type of ip_ntwrk.hosts() is list for LOOPBACK_INTERFACE ip address FC00:1::38/128, can't be called for next() function. For VLAN_INTERFACE, it has some non-ip address key for dualtor testbed, such as grat_arp or proxy_arp, if call ipaddress.ip_network for them, it will throw ValueError exception, but in existing code, it executes pass next. At this time, the iface_table_name == "VLAN_INTERFACE", the code will execute next() function for previous ip_ntwrk which is got from LOOPBACK_INTERFACE. According to previous saying, the TypeError: 'list' object is not an iterator will happen here. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
- Loading branch information