mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
912d6ed8cc
- Replace find ';' with '+' for faster execution. - Replace grep -R with -r to avoid recursive warnings. - Exclude .git and .tox directories from recursive grep. - Improve messaging on failed sanity checks. - Add no-basestring check to Shippable.
16 lines
469 B
Bash
Executable file
16 lines
469 B
Bash
Executable file
#!/bin/sh
|
|
|
|
urllib_users=$(find . -name '*.py' -exec grep -H urlopen '{}' '+' | grep -v \
|
|
-e '^[^:]*/.tox/' \
|
|
-e '^\./lib/ansible/module_utils/urls.py:' \
|
|
-e '^\./lib/ansible/module_utils/six.py:' \
|
|
-e '^\./lib/ansible/compat/six/_six.py:' \
|
|
-e '^[^:]*:#'
|
|
)
|
|
|
|
if [ "${urllib_users}" ]; then
|
|
echo "${urllib_users}"
|
|
echo "One or more file(s) listed above use urlopen."
|
|
echo "Use open_url from module_utils instead of urlopen."
|
|
exit 1
|
|
fi
|