Fix some new pylint "W" warnings

After updating pylint, it started emitting additional "W"
warnings in some cases, fix some of them.

  modified-iterating-list,
  implicit-str-concat,
  global-variable-not-assigned

Trivialfix

Change-Id: I7deb5f1e0aa2852cb033c78dcb4c8bc87e34be1e
This commit is contained in:
Brian Haley 2023-05-07 23:13:32 -04:00
parent ed274efcf7
commit 4757b46646
5 changed files with 4 additions and 10 deletions

View File

@ -59,13 +59,10 @@ disable=
raise-missing-from,
arguments-renamed,
broad-exception-raised,
modified-iterating-list,
unspecified-encoding,
missing-timeout,
implicit-str-concat,
redundant-u-string-prefix,
unused-private-member,
global-variable-not-assigned,
# "C" Coding convention violations
consider-iterating-dictionary,
consider-using-enumerate,

View File

@ -731,7 +731,7 @@ class IptablesFirewallDriver(firewall.FirewallDriver):
def _drop_invalid_packets(self, iptables_rules):
# Always drop invalid packets
iptables_rules += [comment_rule('-m state --state ' 'INVALID -j DROP',
iptables_rules += [comment_rule('-m state --state INVALID -j DROP',
comment=ic.INVALID_DROP)]
return iptables_rules

View File

@ -769,7 +769,7 @@ def attach_exc_details(e, msg, args=_NO_ARGS_MARKER):
def extract_exc_details(e):
for attr in ('_error_context_msg', '_error_context_args'):
if not hasattr(e, attr):
return u'No details.'
return 'No details.'
details = e._error_context_msg
args = e._error_context_args
if args is _NO_ARGS_MARKER:

View File

@ -284,7 +284,7 @@ class OvnNbSynchronizer(OvnDbSynchronizer):
# Remove the common ones
for na in list(neutron_acls):
for ovn_a in ovn_acls:
for ovn_a in ovn_acls.copy():
if all(item in na.items() for item in ovn_a.items()):
neutron_acls.remove(na)
ovn_acls.remove(ovn_a)

View File

@ -104,8 +104,5 @@ def init_handler(resource, event, trigger, payload=None):
def unregister():
"""Cleanup fanout queues"""
global TRUNK_SKELETON
try:
if TRUNK_SKELETON:
TRUNK_SKELETON.unregister()
except AttributeError:
pass