Optimize querying for security groups
Optimize querying for security groups

In the check for all security groups on port belong to tenant,
add a filter to get security groups for the tenant which are in
common with the security groups of the port.

Change-Id: I66f31755525fca37f9dbce6fb43e475791f82495
Closes-Bug: #1315097

projectcalico/calico-neutron,gopal1cloud/neutron,klmitch/neutron,infobloxopen/neutron,dims/neutron,MaximNevrov/neutron,wenhuizhang/neutron,asgard-lab/neutron,openstack/neutron,gopal1cloud/neutron,mahak/neutron,antonioUnina/neutron,gkotton/neutron,eayunstack/neutron,gkotton/neutron,antonioUnina/neutron,neoareslinux/neutron,jumpojoy/neutron,chitr/neutron,leeseuljeong/leeseulstack_neutron,aristanetworks/neutron,eonpatapon/neutron,rdo-management/neutron,skyddv/neutron,virtualopensystems/neutron,silenci/neutron,yamahata/tacker,pnavarro/neutron,NeCTAR-RC/neutron,JianyuWang/neutron,blueboxgroup/neutron,leeseulstack/openstack,infobloxopen/neutron,noironetworks/neutron,eonpatapon/neutron,jacknjzhou/neutron,magic0704/neutron,virtualopensystems/neutron,yuewko/neutron,silenci/neutron,mahak/neutron,leeseulstack/openstack,cisco-openstack/neutron,glove747/liberty-neutron,vveerava/Openstack,jumpojoy/neutron,pnavarro/neutron,cloudbase/neutron-virtualbox,rdo-management/neutron,openstack/neutron,neoareslinux/neutron,dhanunjaya/neutron,MaximNevrov/neutron,magic0704/neutron,JioCloud/neutron,shahbazn/neutron,wenhuizhang/neutron,yanheven/neutron,mmnelemane/neutron,JianyuWang/neutron,adelina-t/neutron,huntxu/neutron,waltBB/neutron_read,bigswitch/neutron,cloudbase/neutron-virtualbox,blueboxgroup/neutron,jerryz1982/neutron,mmnelemane/neutron,bigswitch/neutron,swdream/neutron,apporc/neutron,NeCTAR-RC/neutron,suneeth51/neutron,Stavitsky/neutron,Metaswitch/calico-neutron,takeshineshiro/neutron,yamahata/tacker,noironetworks/neutron,watonyweng/neutron,mahak/neutron,jerryz1982/neutron,shahbazn/neutron,huntxu/neutron,yanheven/neutron,watonyweng/neutron,vbannai/neutron,cernops/neutron,CiscoSystems/neutron,mandeepdhami/neutron,vveerava/Openstack,CiscoSystems/neutron,vbannai/neutron,cloudbase/neutron,javaos74/neutron,cisco-openstack/neutron,yamahata/tacker,miyakz1192/neutron,openstack/neutron,swdream/neutron,adelina-t/neutron,paninetworks/neutron,miyakz1192/neutron,aristanetworks/neutron,vbannai/neutron,JioCloud/neutron,eayunstack/neutron,leeseuljeong/leeseulstack_neutron,SmartInfrastructures/neutron,takeshineshiro/neutron,bgxavier/neutron,wolverineav/neutron,igor-toga/local-snat,skyddv/neutron,barnsnake351/neutron,Metaswitch/calico-neutron,glove747/liberty-neutron,CiscoSystems/neutron,dims/neutron,javaos74/neutron,jacknjzhou/neutron,redhat-openstack/neutron,leeseulstack/openstack,bgxavier/neutron,projectcalico/calico-neutron,mandeepdhami/neutron,cloudbase/neutron,redhat-openstack/neutron,yuewko/neutron,apporc/neutron,alexandrucoman/vbox-neutron-agent,waltBB/neutron_read,dhanunjaya/neutron,igor-toga/local-snat,vivekanand1101/neutron,chitr/neutron,SamYaple/neutron,gkotton/neutron,SmartInfrastructures/neutron,cernops/neutron,klmitch/neutron,mattt416/neutron,sasukeh/neutron,virtualopensystems/neutron,Stavitsky/neutron,mattt416/neutron,blueboxgroup/neutron,sebrandon1/neutron,leeseuljeong/leeseulstack_neutron,vivekanand1101/neutron,suneeth51/neutron,sasukeh/neutron,SamYaple/neutron,vveerava/Openstack,paninetworks/neutron,asgard-lab/neutron,alexandrucoman/vbox-neutron-agent,sebrandon1/neutron,barnsnake351/neutron,wolverineav/neutron