Use newer flake8 on python3.8 zuul systems

flake8 2.5.5 fails on ubuntu-focal zuul machines running python3.8
with the following error:
AttributeError: 'FlakesChecker' object has no attribute 'CONSTANT'

Fixed:
 E117 over-indented
 E741 ambiguous variable name
 F841 local variable is assigned to but never used

Per-Line-Suppressed:
 E402 module level import not at top of file
 F632 use ==/!= to compare constant literals

Global Suppress:
 W504 line break after binary operator
 W605 invalid escape sequence

The suppressed errors can be fixed by later submissions.

Change-Id: I2df3ece427f0c84ce16c1a82f4d9f0c9a5a6982b
Partial-Bug: 1895054
Signed-off-by: albailey <Al.Bailey@windriver.com>
This commit is contained in:
albailey 2020-11-16 13:09:11 -06:00
parent 454aa61326
commit 42a9cfa882
10 changed files with 35 additions and 32 deletions

View File

@ -8,7 +8,7 @@
import sys
from oslo_config import cfg
cfg.CONF(sys.argv[1:], project='fm')
from fm.db import migration
from fm.db import migration # noqa: E402
CONF = cfg.CONF

View File

@ -154,7 +154,7 @@ class HTTPClient(_BaseHTTPClient):
if kwargs.get('insecure', False) is True:
self.session.verify = False
else:
if kwargs.get('cacert', None) is not '':
if kwargs.get('cacert', None) is not '': # noqa: F632
self.session.verify = kwargs.get('cacert', True)
self.session.cert = (kwargs.get('cert_file'),

View File

@ -315,7 +315,7 @@ def main():
print('caught: %r, aborting' % (e), file=sys.stderr)
sys.exit(0)
except IOError as e:
except IOError:
sys.exit(0)
except Exception as e:

View File

@ -79,8 +79,8 @@ def do_event_list(cc, args={}):
logs = cc.event_log.list(q=queryAsArray, limit=args.limit,
alarms=alarms, logs=logs,
include_suppress=include_suppress)
for l in logs:
utils.normalize_field_data(l, ['entity_instance_id', 'reason_text'])
for lg in logs:
utils.normalize_field_data(lg, ['entity_instance_id', 'reason_text'])
# omit action initially to keep output width sane
# (can switch over to vertical formatting when available from CLIFF)

View File

@ -1,4 +1,4 @@
hacking!=0.13.0,<0.14,>=0.12.0
hacking
bashate >= 0.2
mock
PyYAML >= 3.1.0

View File

@ -88,11 +88,14 @@ commands =
# H405 multi line docstring summary not separated with an empty line
# H702 Argument to ... must be a string
# H903 Windows style line endings not allowed in code
# W504 line break after binary operator
# W605 invalid escape sequence
# E123, E125 skipped as they are invalid PEP-8.
# E501 skipped because some of the code files include templates
# that end up quite wide
show-source = True
ignore = H102,H104,H105,H301,H306,H401,H403,H404,H405,H702,H903,E123,E125,E501
ignore = H102,H104,H105,H301,H306,H401,H403,H404,H405,H702,H903,
W504,W605,E123,E125,E501
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-*
# TODO: H106 Dont put vim configuration in source files (off by default).
# H203 Use assertIs(Not)None to check for None (off by default).