diff options
Diffstat (limited to 'test/code-smell/replace-urlopen.sh')
-rwxr-xr-x | test/code-smell/replace-urlopen.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/code-smell/replace-urlopen.sh b/test/code-smell/replace-urlopen.sh new file mode 100755 index 0000000000..410b2e565e --- /dev/null +++ b/test/code-smell/replace-urlopen.sh @@ -0,0 +1,12 @@ +#!/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\)/d') +if test -n "$URLLIB_USERS" ; then + printf "$URLLIB_USERS" + exit 1 +else + exit 0 +fi |