Addressed more pylint issues

Change-Id: I888d8b4725e07753e608739ee09bde582184c473
This commit is contained in:
Sorin Sbarnea 2021-03-15 15:03:36 +00:00
parent 5dd2b4d4e8
commit 08902597bc
4 changed files with 25 additions and 33 deletions

View File

@ -12,7 +12,7 @@ repos:
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.8.4
rev: 3.9.0
hooks:
- id: flake8
- repo: https://github.com/openstack-dev/bashate.git
@ -28,6 +28,6 @@ repos:
# use jinja templating, this will often fail and the syntax
# error will be discovered in execution anyway)
- repo: https://github.com/PyCQA/pylint
rev: pylint-2.6.0
rev: pylint-2.7.2
hooks:
- id: pylint

View File

@ -17,7 +17,6 @@ disable =
import-error,
inconsistent-return-statements,
invalid-name,
lost-exception,
missing-class-docstring,
missing-function-docstring,
missing-module-docstring,
@ -28,7 +27,6 @@ disable =
redefined-argument-from-local,
redefined-builtin,
redefined-outer-name,
simplifiable-if-statement,
super-init-not-called,
super-with-arguments,
superfluous-parens,
@ -42,14 +40,12 @@ disable =
too-many-nested-blocks,
too-many-public-methods,
too-many-statements,
try-except-raise,
unidiomatic-typecheck,
unnecessary-comprehension,
unnecessary-pass,
unsubscriptable-object,
unused-argument,
unused-variable,
useless-else-on-loop,
useless-object-inheritance,
useless-super-delegation,
wrong-import-order,

View File

@ -354,31 +354,31 @@ class BuildahBuilder(base.BaseBuilder):
exception=job._exception
)
)
else:
if exceptions:
raise RuntimeError(
'\nThe following errors were detected during '
'container build(s):\n{exceptions}'.format(
exceptions='\n'.join(exceptions)
)
if exceptions:
raise RuntimeError(
'\nThe following errors were detected during '
'container build(s):\n{exceptions}'.format(
exceptions='\n'.join(exceptions)
)
)
if not_done:
error_msg = (
'The following jobs were incomplete: {}'.format(
[future_to_build[job] for job in not_done]
)
if not_done:
error_msg = (
'The following jobs were incomplete: {}'.format(
[future_to_build[job] for job in not_done]
)
)
jobs_with_exceptions = [{
'container': future_to_build[job],
'exception': job._exception}
for job in not_done if job._exception]
if jobs_with_exceptions:
for job_with_exception in jobs_with_exceptions:
error_msg = error_msg + os.linesep + (
"%(container)s raised the following "
"exception: %(exception)s" %
job_with_exception)
jobs_with_exceptions = [{
'container': future_to_build[job],
'exception': job._exception}
for job in not_done if job._exception]
if jobs_with_exceptions:
for job_with_exception in jobs_with_exceptions:
error_msg = error_msg + os.linesep + (
"%(container)s raised the following "
"exception: %(exception)s" %
job_with_exception)
raise SystemError(error_msg)
raise SystemError(error_msg)

View File

@ -1980,8 +1980,6 @@ class PythonImageUploader(BaseImageUploader):
LOG.error('[%s] Failed processing layer for the target '
'image %s' % (layer, target_url.geturl()))
raise
except Exception:
raise
else:
if layer_val and known_path:
image_ref = target_url.path.split(':')[0][1:]
@ -2343,8 +2341,6 @@ class PythonImageUploader(BaseImageUploader):
LOG.error('[%s] Failed processing layer for the target '
'image %s' % (layer['digest'], target_url.geturl()))
raise
except Exception:
raise
else:
if layer_val and known_path:
image_ref = target_url.path.split(':')[0][1:]