Fixed bug for unbound ports removal

This commit is contained in:
Florent Flament 2014-02-21 13:50:26 +00:00
parent 22914da240
commit 814c147ae7
2 changed files with 7 additions and 3 deletions

View File

@ -306,9 +306,13 @@ class NeutronInterfaces(NeutronResources):
class NeutronPorts(NeutronResources):
# When created, unbound ports' device_owner are "". device_owner
# is of the form" compute:*" if it has been bound to some vm in
# the past.
def list(self):
all_ports = [port for port in self.client.list_ports()['ports']
if port["device_owner"] == ""]
if port["device_owner"] == ""
or port["device_owner"].startswith("compute:")]
return filter(self._owned_resource, all_ports)
def delete(self, port):

View File

@ -300,7 +300,7 @@ ROUTER0_PORTS = {
"network_id":"ebda9658-093b-41ba-80ce-0cf8cb8365d4",
"tenant_id": PROJECT_ID,
"binding:vif_type":"ovs",
"device_owner":"compute:None",
"device_owner":"network:router_gateway",
"binding:capabilities":{
"port_filter":False
},
@ -376,7 +376,7 @@ NEUTRON_PORTS = {
"binding:host_id": "",
"binding:vif_type": "unbound",
"device_id": "",
"device_owner": "",
"device_owner": "compute:azerty",
"extra_dhcp_opts": [],
"fixed_ips": [
{