Fix pylint invalid-sequence-index false positive for internal_ports (2)
Pylint 3.3.x cannot infer that iterating over ``self.internal_ports`` (``list[dict[str]]``) yields ``dict`` items, so it wrongly flags ``p['id']`` as an invalid sequence index. Silence the two remaining false positives in dvr_local_router.py with inline ``# pylint: disable`` comments. Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com> Change-Id: Ife8540e3ecd62a7432a19a892426d5dbe041db33
This commit is contained in:
committed by
Rodolfo Alonso
parent
260a63e118
commit
3a83f29fd7
@@ -604,7 +604,8 @@ class DvrLocalRouter(dvr_router_base.DvrRouterBase):
|
||||
if (not address_scopes_match or
|
||||
(self.agent_conf.agent_mode ==
|
||||
lib_constants.L3_AGENT_MODE_DVR_NO_EXTERNAL)):
|
||||
internal_dev = self.get_internal_device_name(p['id'])
|
||||
internal_dev = self.get_internal_device_name(
|
||||
p['id']) # pylint: disable=invalid-sequence-index
|
||||
self._snat_redirect_add(gateway, p, internal_dev)
|
||||
|
||||
def disable_snat_redirect_rules(self, ex_gw_port):
|
||||
@@ -618,7 +619,8 @@ class DvrLocalRouter(dvr_router_base.DvrRouterBase):
|
||||
if (not address_scopes_match or
|
||||
(self.agent_conf.agent_mode ==
|
||||
lib_constants.L3_AGENT_MODE_DVR_NO_EXTERNAL)):
|
||||
internal_dev = self.get_internal_device_name(p['id'])
|
||||
internal_dev = self.get_internal_device_name(
|
||||
p['id']) # pylint: disable=invalid-sequence-index
|
||||
self._snat_redirect_remove(gateway, p, internal_dev)
|
||||
|
||||
def external_gateway_added(self, ex_gw_port, interface_name):
|
||||
|
||||
Reference in New Issue
Block a user