Delete ports without device_owner on ns deletion

Neutron clears device_owner when port is detached. This means that with
pools we need to consider ports without device_owner set when doing
cleanup on namespace deletion.

Change-Id: Ic38015cba27d8418175027ec4e433df32eae4706
This commit is contained in:
Michał Dulko 2020-09-03 17:08:27 +02:00
parent 1b99b1170c
commit 41c00f6584
1 changed files with 3 additions and 1 deletions

View File

@ -106,7 +106,9 @@ class NamespacePodSubnetDriver(default_subnet.DefaultPodSubnetDriver):
"Deleting leftovers ports before retrying", net_id)
leftover_ports = os_net.ports(network_id=net_id)
for leftover_port in leftover_ports:
if leftover_port.device_owner not in ['trunk:subport',
# NOTE(dulek): '' is there because Neutron seems to unset
# device_owner on detach.
if leftover_port.device_owner not in ['', 'trunk:subport',
kl_const.DEVICE_OWNER]:
continue
try: