@@ -1130,7 +1130,7 @@ def _test_set_port_status_down(self, is_compute_port=False):
1130
1130
resources .PORT ,
1131
1131
provisioning_blocks .L2_AGENT_ENTITY
1132
1132
)
1133
- ude .assert_called_once_with (port1 ['port' ]['id' ])
1133
+ ude .assert_called_once_with (port1 ['port' ]['id' ], False )
1134
1134
1135
1135
# If the port does NOT bellong to compute, do not notify Nova
1136
1136
# about it's status changes
@@ -1175,7 +1175,7 @@ def test_set_port_status_concurrent_delete(self):
1175
1175
side_effect = exc ) as apc , \
1176
1176
mock .patch .object (self .mech_driver ,
1177
1177
'_update_dnat_entry_if_needed' ) as ude :
1178
- self .mech_driver .set_port_status_down (port1 ['port' ]['id' ])
1178
+ self .mech_driver .set_port_status_down (port1 ['port' ]['id' ], False )
1179
1179
apc .assert_called_once_with (
1180
1180
mock .ANY ,
1181
1181
port1 ['port' ]['id' ],
@@ -2382,40 +2382,32 @@ def test_agent_with_nb_cfg_timestamp_not_timeout(self):
2382
2382
self .assertTrue (agent .alive , "Agent of type %s alive=%s" % (
2383
2383
agent .agent_type , agent .alive ))
2384
2384
2385
- def _test__update_dnat_entry_if_needed (self , dvr = True ):
2386
- if dvr :
2387
- ovn_conf .cfg .CONF .set_override (
2388
- 'enable_distributed_floating_ip' , True , group = 'ovn' )
2385
+ def _test__update_dnat_entry_if_needed (self , up = True ):
2386
+ ovn_conf .cfg .CONF .set_override (
2387
+ 'enable_distributed_floating_ip' , True , group = 'ovn' )
2389
2388
port_id = 'fake-port-id'
2390
2389
fake_ext_mac_key = 'fake-ext-mac-key'
2391
2390
fake_nat_uuid = uuidutils .generate_uuid ()
2392
2391
nat_row = fakes .FakeOvsdbRow .create_one_ovsdb_row (
2393
2392
attrs = {'_uuid' : fake_nat_uuid , 'external_ids' : {
2394
2393
ovn_const .OVN_FIP_EXT_MAC_KEY : fake_ext_mac_key },
2395
2394
'external_mac' : 'aa:aa:aa:aa:aa:aa' })
2396
-
2397
2395
fake_db_find = mock .Mock ()
2398
2396
fake_db_find .execute .return_value = [nat_row ]
2399
2397
self .nb_ovn .db_find .return_value = fake_db_find
2400
-
2401
- self .mech_driver ._update_dnat_entry_if_needed (port_id )
2402
-
2403
- if dvr :
2398
+ self .mech_driver ._update_dnat_entry_if_needed (port_id , up = up )
2399
+ if up :
2404
2400
# Assert that we are setting the external_mac in the NAT table
2405
2401
self .nb_ovn .db_set .assert_called_once_with (
2406
2402
'NAT' , fake_nat_uuid , ('external_mac' , fake_ext_mac_key ))
2407
- self .nb_ovn .db_clear .assert_not_called ()
2408
2403
else :
2409
- self .nb_ovn .db_set .assert_not_called ()
2410
2404
# Assert that we are cleaning the external_mac from the NAT table
2411
2405
self .nb_ovn .db_clear .assert_called_once_with (
2412
2406
'NAT' , fake_nat_uuid , 'external_mac' )
2413
-
2414
- def test__update_dnat_entry_if_needed_dvr (self ):
2407
+ def test__update_dnat_entry_if_needed_up (self ):
2415
2408
self ._test__update_dnat_entry_if_needed ()
2416
-
2417
- def test__update_dnat_entry_if_needed_no_dvr (self ):
2418
- self ._test__update_dnat_entry_if_needed (dvr = False )
2409
+ def test__update_dnat_entry_if_needed_down (self ):
2410
+ self ._test__update_dnat_entry_if_needed (up = False )
2419
2411
2420
2412
@mock .patch ('neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb.'
2421
2413
'ovn_client.OVNClient._get_router_ports' )
0 commit comments