Merge "Fix some new pylint "W" warnings"

This commit is contained in:
Zuul 2023-08-02 11:03:07 +00:00 committed by Gerrit Code Review
commit 62bbfad8ff
5 changed files with 4 additions and 10 deletions

View File

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

View File

@ -731,7 +731,7 @@ class IptablesFirewallDriver(firewall.FirewallDriver):
def _drop_invalid_packets(self, iptables_rules): def _drop_invalid_packets(self, iptables_rules):
# Always drop invalid packets # 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)] comment=ic.INVALID_DROP)]
return iptables_rules return iptables_rules

View File

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

View File

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

View File

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