From 1e12051d7409a34f79e8d53cb70ab8cc5acf8e78 Mon Sep 17 00:00:00 2001 From: Anders Harrisson <anders.harrisson@ess.eu> Date: Wed, 6 Jul 2022 07:54:21 +0200 Subject: [PATCH] Update pre-commit (black and flake8) --- .pre-commit-config.yaml | 4 ++-- app/tasks.py | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index efb8ab5..c27656b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,9 @@ repos: - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.6.0 hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.3 + rev: 4.0.1 hooks: - id: flake8 diff --git a/app/tasks.py b/app/tasks.py index 28a7993..915e7ec 100644 --- a/app/tasks.py +++ b/app/tasks.py @@ -106,14 +106,10 @@ def launch_awx_job(resource="job", **kwargs): if job_template is None and inventory_source is None: current_app.logger.warning("No job_template nor inventory_source passed!") return "No job_template nor inventory_source passed!" - if ( - job_template - in ( - current_app.config["AWX_CREATE_VIOC"], - current_app.config["AWX_CREATE_VM"], - ) - and not current_app.config.get("AWX_VM_CREATION_ENABLED", False) - ): + if job_template in ( + current_app.config["AWX_CREATE_VIOC"], + current_app.config["AWX_CREATE_VM"], + ) and not current_app.config.get("AWX_VM_CREATION_ENABLED", False): current_app.logger.info("AWX VM creation is disabled. Not sending any request.") return "AWX VM creation not triggered" if not current_app.config.get("AWX_JOB_ENABLED", False): -- GitLab