From 60723a48f8ddc338053c83a12a1cae23214761f2 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Sun, 15 Mar 2020 05:24:43 +0100 Subject: [PATCH] Remove unnecessary check if agent object from db is not None In create_fip_agent_gw_port_if_not_exists() method in neutron.db.l3_dvr_db module, there was unnecessary check if object returned from _get_agent_by_type_and_host() method is not None or not empty dict. But in fact this method will always return not empty dict or raise an AgentNotFoundByTypeHost exception which is already properly handled. TrivialFix Change-Id: I71379e21a307326d6fca5798a588630ed3ff5263 --- neutron/db/l3_dvr_db.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/neutron/db/l3_dvr_db.py b/neutron/db/l3_dvr_db.py index b38c9860b4a..32249ab5bcb 100644 --- a/neutron/db/l3_dvr_db.py +++ b/neutron/db/l3_dvr_db.py @@ -1045,8 +1045,6 @@ class _DVRAgentInterfaceMixin(object): {'ag': const.AGENT_TYPE_L3, 'host': host}) return - if not l3_agent_db: - return l3_agent_mode = self._get_agent_mode(l3_agent_db) if l3_agent_mode == const.L3_AGENT_MODE_DVR_NO_EXTERNAL: