Browse Source

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

changes/22/676922/1
Zuul 1 month ago
parent
commit
effd1955db

+ 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

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

Loading…
Cancel
Save