Merge "Fix port creation with generated payload."
This commit is contained in:
@@ -44,7 +44,7 @@ class NestedMacvlanPodVIFDriver(nested_vif.NestedPodVIFDriver):
|
||||
vm_port = self._get_parent_port(pod)
|
||||
|
||||
if not container_port:
|
||||
container_port = neutron.create_port(req).get('port')
|
||||
container_port = neutron.create_port({'port': req}).get('port')
|
||||
_tag_neutron_port(container_port['id'])
|
||||
|
||||
container_mac = container_port['mac_address']
|
||||
|
@@ -177,4 +177,4 @@ class SriovVIFDriver(neutron_vif.NeutronPodVIFDriver):
|
||||
if security_groups:
|
||||
port_req_body['security_groups'] = security_groups
|
||||
|
||||
return {'port': port_req_body}
|
||||
return port_req_body
|
||||
|
@@ -58,7 +58,7 @@ class TestNestedMacvlanPodVIFDriver(test_base.TestCase):
|
||||
|
||||
m_driver._get_port_request.assert_called_once_with(
|
||||
pod, project_id, subnets, security_groups)
|
||||
neutron.create_port.assert_called_once_with(port_request)
|
||||
neutron.create_port.assert_called_once_with({'port': port_request})
|
||||
m_driver._get_parent_port.assert_called_once_with(pod)
|
||||
m_driver._try_update_port.assert_called_once()
|
||||
m_to_vif.assert_called_once_with(container_port['port'], subnets)
|
||||
@@ -83,7 +83,7 @@ class TestNestedMacvlanPodVIFDriver(test_base.TestCase):
|
||||
m_driver, pod, project_id, subnets, security_groups)
|
||||
m_driver._get_port_request.assert_called_once_with(
|
||||
pod, project_id, subnets, security_groups)
|
||||
neutron.create_port.assert_called_once_with(port_request)
|
||||
neutron.create_port.assert_called_once_with({'port': port_request})
|
||||
m_driver._try_update_port.assert_not_called()
|
||||
m_to_vif.assert_not_called()
|
||||
|
||||
|
Reference in New Issue
Block a user