Optimize delete_csnat_router_interface_ports db query
Optimize delete_csnat_router_interface_ports db query

Currently delete_csnat_router_interface_ports provides an iterator as
filter to core_plugin.get_ports which is used in a SQL IN argument.
SQLAlchemy is able to avoid some db queries when the IN argument is
empty BUT not when the argument is an empty iterator and raises the
warning:

 SAWarning: The IN-predicate on "ports.id" was invoked with an empty
 sequence. This results in a contradiction, which nonetheless can be
 expensive to evaluate. Consider alternative strategies for improved
 performance.

This change replaces the iterator by a list in order to optimize db
queries when the filter is empty.

Closes-Bug: #1503852
Change-Id: I4f53433d688dfa020927118a18020b1a6aa55517

sebrandon1/neutron,sebrandon1/neutron,cloudbase/neutron,bigswitch/neutron,bigswitch/neutron,yanheven/neutron,openstack/neutron,huntxu/neutron,eayunstack/neutron,apporc/neutron,klmitch/neutron,yanheven/neutron,dims/neutron,igor-toga/local-snat,noironetworks/neutron,mahak/neutron,MaximNevrov/neutron,jumpojoy/neutron,jumpojoy/neutron,MaximNevrov/neutron,chitr/neutron,eayunstack/neutron,wolverineav/neutron,openstack/neutron,mahak/neutron,dims/neutron,igor-toga/local-snat,huntxu/neutron,apporc/neutron,mahak/neutron,openstack/neutron,cloudbase/neutron,wolverineav/neutron,chitr/neutron,noironetworks/neutron,klmitch/neutron