Browse Source

Merge "Make sure the port still in port map when prepare_port_filter" into stable/queens

changes/56/677056/1
Zuul 1 month ago
parent
commit
a74539bfab

+ 3
- 1
neutron/agent/linux/openvswitch_firewall/firewall.py View File

@@ -534,7 +534,9 @@ class OVSFirewallDriver(firewall.FirewallDriver):
534 534
             if of_port.ofport != ovs_port.ofport:
535 535
                 self.sg_port_map.remove_port(of_port)
536 536
                 of_port = OFPort(port, ovs_port, of_port.vlan_tag)
537
-            self.sg_port_map.update_port(of_port, port)
537
+                self.sg_port_map.create_port(of_port, port)
538
+            else:
539
+                self.sg_port_map.update_port(of_port, port)
538 540
 
539 541
         return of_port
540 542
 

+ 1
- 0
neutron/tests/unit/agent/linux/openvswitch_firewall/test_firewall.py View File

@@ -475,6 +475,7 @@ class TestOVSFirewallDriver(base.BaseTestCase):
475 475
         self.mock_bridge.br.get_vif_port_by_id.return_value = \
476 476
             fake_ovs_port
477 477
         port = self.firewall.get_or_create_ofport(port_dict)
478
+        self.assertIn(of_port.id, self.firewall.sg_port_map.ports.keys())
478 479
         self.assertEqual(port.ofport, 2)
479 480
 
480 481
     def test_get_or_create_ofport_missing(self):

Loading…
Cancel
Save