Browse Source

Merge "Check ret for None in zuul_run_command" into feature/zuulv3

changes/83/482683/1
Jenkins 4 years ago
committed by Gerrit Code Review
parent
commit
fa1f2ca5a1
2 changed files with 6 additions and 2 deletions
  1. +4
    -0
      tests/fixtures/config/ansible/git/common-config/playbooks/hello-post.yaml
  2. +2
    -2
      zuul/ansible/library/command.py

+ 4
- 0
tests/fixtures/config/ansible/git/common-config/playbooks/hello-post.yaml View File

@ -10,3 +10,7 @@
that:
- st.stat.exists
- st.stat.isreg
- name: Simple shell task.
shell: |+
echo "Hello world"

+ 2
- 2
zuul/ansible/library/command.py View File

@ -409,9 +409,9 @@ def zuul_run_command(self, args, zuul_log_id, check_rc=False, close_fds=True, ex
if t.isAlive():
console.addLine("[Zuul] standard output/error still open "
"after child exited")
if not ret and fail_json_kwargs:
if ret is None and fail_json_kwargs:
ret = fail_json_kwargs['rc']
elif not ret and not fail_json_kwargs:
elif ret is None and not fail_json_kwargs:
ret = -1
console.addLine("[Zuul] Task exit code: %s\n" % ret)
if ret == -1 and not fail_json_kwargs:


Loading…
Cancel
Save