Merge "NSX|V fix exclude list counting"

This commit is contained in:
Zuul 2017-10-17 16:29:21 +00:00 committed by Gerrit Code Review
commit 14399bdf0b

View File

@ -1820,9 +1820,10 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
there are, so we can decide on adding / removing the device from
the exclusion list
"""
filters = {'device_id': [device_id],
'device_owner': ['compute:None']}
ports = self.get_ports(context.elevated(), filters=filters)
filters = {'device_id': [device_id]}
device_ports = self.get_ports(context.elevated(), filters=filters)
ports = [port for port in device_ports
if port['device_owner'].startswith('compute')]
return len([p for p in ports
if validators.is_attr_set(p.get(ext_vnic_idx.VNIC_INDEX))
and not p[psec.PORTSECURITY]])