Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linting fixes #1112

Merged
merged 1 commit into from Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions ansible_runner/__main__.py
Expand Up @@ -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
4 changes: 2 additions & 2 deletions ansible_runner/cleanup.py
Expand Up @@ -79,9 +79,9 @@ def is_alive(dir):

try:
os.kill(pid, signal.SIG_DFL)
Akasurde marked this conversation as resolved.
Show resolved Hide resolved
return(0)
return 0
except OSError:
return(1)
return 1


def project_idents(dir):
Expand Down
2 changes: 1 addition & 1 deletion test/requirements.txt
Expand Up @@ -3,5 +3,5 @@ pytest-cov
pytest-mock
pytest-timeout
pytest-xdist
flake8
flake8==4.0.1
yamllint