diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 201d4237d..60572ffdc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/.pylintrc b/.pylintrc index 559261737..1601ed390 100644 --- a/.pylintrc +++ b/.pylintrc @@ -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, diff --git a/tripleo_common/image/builder/buildah.py b/tripleo_common/image/builder/buildah.py index 5425d8fdf..56c2f747f 100644 --- a/tripleo_common/image/builder/buildah.py +++ b/tripleo_common/image/builder/buildah.py @@ -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) diff --git a/tripleo_common/image/image_uploader.py b/tripleo_common/image/image_uploader.py index eaf6e7f85..5525ab640 100644 --- a/tripleo_common/image/image_uploader.py +++ b/tripleo_common/image/image_uploader.py @@ -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:]