Skip to content

Commit

Permalink
Fix handling of ansible-doc errors. (ansible#4992)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclay authored Sep 23, 2016
1 parent edf361a commit 7412044
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/utils/shippable/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,21 @@ pip list

source hacking/env-setup

docs_status=0

PAGER=/bin/cat \
ANSIBLE_DEPRECATION_WARNINGS=false \
bin/ansible-doc -l \
2>/tmp/ansible-doc.err
2>/tmp/ansible-doc.err || docs_status=$?

if [ -s /tmp/ansible-doc.err ]; then
# report warnings as errors
echo "Output from 'ansible-doc -l' on stderr is considered an error:"
cat /tmp/ansible-doc.err
exit 1
fi

if [ "${docs_status}" -ne 0 ]; then
echo "Running 'ansible-doc -l' failed with no output on stderr and exit code: ${docs_status}"
exit 1
fi

0 comments on commit 7412044

Please sign in to comment.