ansible/test/sanity/code-smell/no-dict-itervalues.sh
Toshio Kuratomi 2fff690caa Update module_utils.six to latest (#22855)
* Update module_utils.six to latest

We've been held back on the version of six we could use on the module
side to 1.4.x because of python-2.4 compatibility.  Now that our minimum
is Python-2.6, we can update to the latest version of six in
module_utils and get rid of the second copy in lib/ansible/compat.
2017-03-23 13:35:05 -07:00

19 lines
571 B
Bash
Executable file

#!/bin/sh
ITERVALUES_USERS=$(grep -rI '\.itervalues' . \
--exclude-dir .git \
--exclude-dir .tox \
--exclude-dir docsite \
| grep -v \
-e 'six\.itervalues' \
-e lib/ansible/module_utils/six/_six.py \
-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