mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Fix urlopen usage to use open_url instead
Add a travis test for urlopen usage
This commit is contained in:
12
test/code-smell/replace-urlopen.sh
Executable file
12
test/code-smell/replace-urlopen.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user