Sets binding:profile to empty dic when unbinding port
When binding preexisting ports, direct/macvtap, nova adds the binding:profile information. But when deleting the VM, the port binding:profile information still kept. This patch sets binding:profile to empty dic when unbinding it. Closes-Bug: #1524643 Change-Id: I127e88a9bcdad44b795a245e566ab276de09fd82
This commit is contained in:
parent
dc905be8b6
commit
caeeb5d505
@ -330,6 +330,7 @@ class API(base_api.NetworkAPI):
|
|||||||
port_req_body = {'port': {'device_id': '', 'device_owner': ''}}
|
port_req_body = {'port': {'device_id': '', 'device_owner': ''}}
|
||||||
if port_binding:
|
if port_binding:
|
||||||
port_req_body['port']['binding:host_id'] = None
|
port_req_body['port']['binding:host_id'] = None
|
||||||
|
port_req_body['port']['binding:profile'] = {}
|
||||||
try:
|
try:
|
||||||
port_client.update_port(port_id, port_req_body)
|
port_client.update_port(port_id, port_req_body)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
@ -3365,6 +3365,7 @@ class TestNeutronv2WithMock(test.TestCase):
|
|||||||
body = {'port': {'device_id': '', 'device_owner': ''}}
|
body = {'port': {'device_id': '', 'device_owner': ''}}
|
||||||
if has_ext:
|
if has_ext:
|
||||||
body['port']['binding:host_id'] = None
|
body['port']['binding:host_id'] = None
|
||||||
|
body['port']['binding:profile'] = {}
|
||||||
update_port_calls = []
|
update_port_calls = []
|
||||||
for p in ports:
|
for p in ports:
|
||||||
update_port_calls.append(mock.call(p, body))
|
update_port_calls.append(mock.call(p, body))
|
||||||
|
Loading…
Reference in New Issue
Block a user