[ovn] OVNClient._get_router_ports: Drop unused parameter

The `get_gw_port` parameter is currently unused, the
implementation hiding behind it also contains a bug, remove it.

Partial-Bug: #2002687
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
Change-Id: Ie0ba5a478fabe9880746f892ef9c00d7e5660195
This commit is contained in:
Frode Nordahl 2023-03-24 12:06:39 +01:00 committed by Dmitrii Shcherbakov
parent e5d4499672
commit 5510cdab92
1 changed files with 8 additions and 11 deletions

View File

@ -1329,20 +1329,17 @@ class OVNClient(object):
'device_owner': [const.DEVICE_OWNER_ROUTER_GW],
'device_id': [router_id]})
def _get_router_ports(self, context, router_id, get_gw_port=False):
def _get_router_ports(self, context, router_id):
# _get_router() will raise a RouterNotFound error if there's no router
# with the router_id
router_db = self._l3_plugin._get_router(context, router_id)
if get_gw_port:
return [p.port for p in router_db.attached_ports]
else:
# When the existing deployment is migrated to OVN
# we may need to consider other port types - DVR_INTERFACE/HA_INTF.
return [p.port for p in router_db.attached_ports
if p.port_type in [const.DEVICE_OWNER_ROUTER_INTF,
const.DEVICE_OWNER_DVR_INTERFACE,
const.DEVICE_OWNER_HA_REPLICATED_INT,
const.DEVICE_OWNER_ROUTER_HA_INTF]]
# When the existing deployment is migrated to OVN
# we may need to consider other port types - DVR_INTERFACE/HA_INTF.
return [p.port for p in router_db.attached_ports
if p.port_type in [const.DEVICE_OWNER_ROUTER_INTF,
const.DEVICE_OWNER_DVR_INTERFACE,
const.DEVICE_OWNER_HA_REPLICATED_INT,
const.DEVICE_OWNER_ROUTER_HA_INTF]]
def _get_v4_network_for_router_port(self, context, port):
cidr = None