2016-12-14 21:16:16 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
ITERVALUES_USERS=$(grep -rI '\.itervalues' . \
|
|
|
|
--exclude-dir .git \
|
|
|
|
--exclude-dir .tox \
|
|
|
|
--exclude-dir docsite \
|
|
|
|
| grep -v \
|
|
|
|
-e 'six\.itervalues' \
|
2017-03-23 21:35:05 +01:00
|
|
|
-e lib/ansible/module_utils/six/_six.py \
|
2016-12-14 21:16:16 +01:00
|
|
|
-e test/sanity/code-smell/no-dict-itervalues.sh \
|
|
|
|
)
|
|
|
|
|
|
|
|
if [ "${ITERVALUES_USERS}" ]; then
|
|
|
|
echo 'itervalues has been removed in python3. Alternatives:'
|
|
|
|
echo ' for VALUE in DICT.values():'
|
|
|
|
echo ' from ansible.module_utils.six import itervalues ; for VALUE in itervalues(DICT):'
|
|
|
|
echo "${ITERVALUES_USERS}"
|
|
|
|
exit 1
|
|
|
|
fi
|