1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-05-13 21:22:23 +00:00
community.general/test/code-smell/replace-urlopen.sh
2016-03-23 08:49:37 -07:00

12 lines
323 B
Bash
Executable file

#!/bin/sh
BASEDIR=${1-"."}
URLLIB_USERS=$(find "$BASEDIR" -name '*.py' -exec grep -H urlopen \{\} \;)
URLLIB_USERS=$(echo "$URLLIB_USERS" | sed '/\(\n\|lib\/ansible\/module_utils\/urls.py\|lib\/ansible\/compat\/six\/_six.py\|.tox\)/d')
if test -n "$URLLIB_USERS" ; then
printf "$URLLIB_USERS"
exit 1
else
exit 0
fi