@@ -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' ],
@@ -2376,40 +2376,32 @@ def test_agent_with_nb_cfg_timestamp_not_timeout(self):
2376
2376
self .assertTrue (agent .alive , "Agent of type %s alive=%s" % (
2377
2377
agent .agent_type , agent .alive ))
2378
2378
2379
- def _test__update_dnat_entry_if_needed (self , dvr = True ):
2380
- if dvr :
2381
- ovn_conf .cfg .CONF .set_override (
2382
- 'enable_distributed_floating_ip' , True , group = 'ovn' )
2379
+ def _test__update_dnat_entry_if_needed (self , up = True ):
2380
+ ovn_conf .cfg .CONF .set_override (
2381
+ 'enable_distributed_floating_ip' , True , group = 'ovn' )
2383
2382
port_id = 'fake-port-id'
2384
2383
fake_ext_mac_key = 'fake-ext-mac-key'
2385
2384
fake_nat_uuid = uuidutils .generate_uuid ()
2386
2385
nat_row = fakes .FakeOvsdbRow .create_one_ovsdb_row (
2387
2386
attrs = {'_uuid' : fake_nat_uuid , 'external_ids' : {
2388
2387
ovn_const .OVN_FIP_EXT_MAC_KEY : fake_ext_mac_key },
2389
2388
'external_mac' : 'aa:aa:aa:aa:aa:aa' })
2390
-
2391
2389
fake_db_find = mock .Mock ()
2392
2390
fake_db_find .execute .return_value = [nat_row ]
2393
2391
self .nb_ovn .db_find .return_value = fake_db_find
2394
-
2395
- self .mech_driver ._update_dnat_entry_if_needed (port_id )
2396
-
2397
- if dvr :
2392
+ self .mech_driver ._update_dnat_entry_if_needed (port_id , up = up )
2393
+ if up :
2398
2394
# Assert that we are setting the external_mac in the NAT table
2399
2395
self .nb_ovn .db_set .assert_called_once_with (
2400
2396
'NAT' , fake_nat_uuid , ('external_mac' , fake_ext_mac_key ))
2401
- self .nb_ovn .db_clear .assert_not_called ()
2402
2397
else :
2403
- self .nb_ovn .db_set .assert_not_called ()
2404
2398
# Assert that we are cleaning the external_mac from the NAT table
2405
2399
self .nb_ovn .db_clear .assert_called_once_with (
2406
2400
'NAT' , fake_nat_uuid , 'external_mac' )
2407
-
2408
- def test__update_dnat_entry_if_needed_dvr (self ):
2401
+ def test__update_dnat_entry_if_needed_up (self ):
2409
2402
self ._test__update_dnat_entry_if_needed ()
2410
-
2411
- def test__update_dnat_entry_if_needed_no_dvr (self ):
2412
- self ._test__update_dnat_entry_if_needed (dvr = False )
2403
+ def test__update_dnat_entry_if_needed_down (self ):
2404
+ self ._test__update_dnat_entry_if_needed (up = False )
2413
2405
2414
2406
@mock .patch ('neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb.'
2415
2407
'ovn_client.OVNClient._get_router_ports' )
0 commit comments