File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
plugins/ml2/drivers/ovn/mech_driver/ovsdb
tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -978,8 +978,10 @@ def add_gw_port_info_to_logical_router_port(self):
978
978
cmds = []
979
979
context = n_context .get_admin_context ()
980
980
for router in self ._ovn_client ._l3_plugin .get_routers (context ):
981
- ext_gw_networks = [
982
- ext_gw ['network_id' ] for ext_gw in router ['external_gateways' ]]
981
+ ext_gw_net_id = (router .get ('external_gateway_info' ) or
982
+ {}).get ('network_id' )
983
+ if not ext_gw_net_id :
984
+ continue
983
985
rtr_name = 'neutron-{}' .format (router ['id' ])
984
986
ovn_lr = self ._nb_idl .get_lrouter (rtr_name )
985
987
for lrp in ovn_lr .ports :
@@ -992,7 +994,7 @@ def add_gw_port_info_to_logical_router_port(self):
992
994
network_id = ovn_network_name .replace ('neutron-' , '' )
993
995
if not network_id :
994
996
continue
995
- is_ext_gw = str (network_id in ext_gw_networks )
997
+ is_ext_gw = str (network_id == ext_gw_net_id )
996
998
external_ids = lrp .external_ids
997
999
external_ids [ovn_const .OVN_ROUTER_IS_EXT_GW ] = is_ext_gw
998
1000
cmds .append (
Original file line number Diff line number Diff line change @@ -943,7 +943,7 @@ def test_add_gw_port_info_to_logical_router_port(self):
943
943
internal_net_id = uuidutils .generate_uuid ()
944
944
routers_db = [{
945
945
'id' : uuidutils .generate_uuid (),
946
- 'external_gateways ' : [ {'network_id' : ext_net_id }] }]
946
+ 'external_gateway_info ' : {'network_id' : ext_net_id }}]
947
947
ext_gw_lrp = fakes .FakeOvsdbRow .create_one_ovsdb_row (
948
948
attrs = {'external_ids' : {
949
949
constants .OVN_NETWORK_NAME_EXT_ID_KEY :
You can’t perform that action at this time.
0 commit comments