NSX|V fix exclude list counting
When adding/removing a port to the exclude list, we check if there are other ports of the same device there. this test was done is a wrong way expecting the device owner to be 'compute:none', instead of starting with 'compute' Change-Id: I5c6ed8f3c5cf0d4ebb63e1a9ec36614fa4c4f15b
This commit is contained in:
parent
1222be4620
commit
479e76c1f5
@ -1820,9 +1820,10 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
|||||||
there are, so we can decide on adding / removing the device from
|
there are, so we can decide on adding / removing the device from
|
||||||
the exclusion list
|
the exclusion list
|
||||||
"""
|
"""
|
||||||
filters = {'device_id': [device_id],
|
filters = {'device_id': [device_id]}
|
||||||
'device_owner': ['compute:None']}
|
device_ports = self.get_ports(context.elevated(), filters=filters)
|
||||||
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
|
return len([p for p in ports
|
||||||
if validators.is_attr_set(p.get(ext_vnic_idx.VNIC_INDEX))
|
if validators.is_attr_set(p.get(ext_vnic_idx.VNIC_INDEX))
|
||||||
and not p[psec.PORTSECURITY]])
|
and not p[psec.PORTSECURITY]])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user