From 2d240e09937131de5ef76cdb9a5621b1fe272789 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 22 Aug 2022 20:02:57 +0530 Subject: [PATCH] Linting fixes (#1112) --- Dockerfile | 4 +++- ansible_runner/__main__.py | 10 +++++----- ansible_runner/cleanup.py | 4 ++-- test/requirements.txt | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 17d2499dd..2df0f0330 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,9 @@ RUN if [ "$ANSIBLE_BRANCH" != "" ] ; then \ # NOTE(pabelanger): For downstream builds, we compile everything from source # over using existing wheels. Do this upstream too so we can better catch # issues. -ENV PIP_OPTS=--no-build-isolation + +# Commenting due to failures in CI +# ENV PIP_OPTS=--no-build-isolation RUN assemble FROM $PYTHON_BASE_IMAGE diff --git a/ansible_runner/__main__.py b/ansible_runner/__main__.py index 704f004cd..725e63d83 100644 --- a/ansible_runner/__main__.py +++ b/ansible_runner/__main__.py @@ -869,21 +869,21 @@ def main(sys_args=None): else: sys.stderr.write(exc) return 1 - return(res.rc) + return res.rc try: with open(pidfile, 'r') as f: pid = int(f.readline()) except IOError: - return(1) + return 1 if vargs.get('command') == 'stop': Runner.handle_termination(pid, pidfile=pidfile) - return (0) + return 0 elif vargs.get('command') == 'is-alive': try: os.kill(pid, signal.SIG_DFL) - return(0) + return 0 except OSError: - return(1) + return 1 diff --git a/ansible_runner/cleanup.py b/ansible_runner/cleanup.py index 46a3605a9..b6eb8154b 100644 --- a/ansible_runner/cleanup.py +++ b/ansible_runner/cleanup.py @@ -79,9 +79,9 @@ def is_alive(dir): try: os.kill(pid, signal.SIG_DFL) - return(0) + return 0 except OSError: - return(1) + return 1 def project_idents(dir): diff --git a/test/requirements.txt b/test/requirements.txt index 14d33e51c..ac3529794 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -3,5 +3,5 @@ pytest-cov pytest-mock pytest-timeout pytest-xdist -flake8 +flake8==4.0.1 yamllint