diff options
Diffstat (limited to 'test/sanity/code-smell')
-rwxr-xr-x | test/sanity/code-smell/boilerplate.sh | 4 | ||||
-rwxr-xr-x | test/sanity/code-smell/no-basestring.sh | 3 | ||||
-rwxr-xr-x | test/sanity/code-smell/no-dict-iteritems.sh | 4 | ||||
-rwxr-xr-x | test/sanity/code-smell/no-dict-itervalues.sh | 4 | ||||
-rwxr-xr-x | test/sanity/code-smell/no-iterkeys.sh | 3 | ||||
-rwxr-xr-x | test/sanity/code-smell/replace-urlopen.sh | 3 | ||||
-rwxr-xr-x | test/sanity/code-smell/use-compat-six.sh | 2 |
7 files changed, 8 insertions, 15 deletions
diff --git a/test/sanity/code-smell/boilerplate.sh b/test/sanity/code-smell/boilerplate.sh index 5ed3bac57b..d5d71e1420 100755 --- a/test/sanity/code-smell/boilerplate.sh +++ b/test/sanity/code-smell/boilerplate.sh @@ -6,7 +6,7 @@ future1=$(find ./bin -type f -exec grep -HL 'from __future__ import (absolute_im metaclass2=$(find ./lib/ansible -path ./lib/ansible/modules -prune \ -o -path ./lib/ansible/modules/__init__.py \ -o -path ./lib/ansible/module_utils -prune \ - -o -path ./lib/ansible/compat/six/_six.py -prune \ + -o -path ./lib/ansible/module_utils/six/_six.py -prune \ -o -path ./lib/ansible/compat/selectors/_selectors2.py -prune \ -o -path ./lib/ansible/utils/module_docs_fragments -prune \ -o -name '*.py' -exec grep -HL '__metaclass__ = type' '{}' '+') @@ -14,7 +14,7 @@ metaclass2=$(find ./lib/ansible -path ./lib/ansible/modules -prune \ future2=$(find ./lib/ansible -path ./lib/ansible/modules -prune \ -o -path ./lib/ansible/modules/__init__.py \ -o -path ./lib/ansible/module_utils -prune \ - -o -path ./lib/ansible/compat/six/_six.py -prune \ + -o -path ./lib/ansible/module_utils/six/_six.py -prune \ -o -path ./lib/ansible/compat/selectors/_selectors2.py -prune \ -o -path ./lib/ansible/utils/module_docs_fragments -prune \ -o -name '*.py' -exec grep -HL 'from __future__ import (absolute_import, division, print_function)' '{}' '+') diff --git a/test/sanity/code-smell/no-basestring.sh b/test/sanity/code-smell/no-basestring.sh index c8d97e4910..ca2bbedc34 100755 --- a/test/sanity/code-smell/no-basestring.sh +++ b/test/sanity/code-smell/no-basestring.sh @@ -6,8 +6,7 @@ BASESTRING_USERS=$(grep -r basestring . \ | grep isinstance \ | grep -v \ -e test/results/ \ - -e lib/ansible/compat/six/_six.py \ - -e lib/ansible/module_utils/six.py \ + -e lib/ansible/module_utils/six/_six.py \ -e lib/ansible/modules/ \ -e '^[^:]*:#' ) diff --git a/test/sanity/code-smell/no-dict-iteritems.sh b/test/sanity/code-smell/no-dict-iteritems.sh index 9984c9c7bc..0335f2f11b 100755 --- a/test/sanity/code-smell/no-dict-iteritems.sh +++ b/test/sanity/code-smell/no-dict-iteritems.sh @@ -6,8 +6,7 @@ ITERITEMS_USERS=$(grep -rI '\.iteritems' . \ --exclude-dir docsite \ | grep -v \ -e 'six\.iteritems' \ - -e lib/ansible/compat/six/_six.py \ - -e lib/ansible/module_utils/six.py \ + -e lib/ansible/module_utils/six/_six.py \ -e test/sanity/code-smell/no-dict-iteritems.sh \ ) @@ -15,7 +14,6 @@ if [ "${ITERITEMS_USERS}" ]; then echo 'iteritems has been removed in python3. Alternatives:' echo ' for KEY, VALUE in DICT.items():' echo ' from ansible.module_utils.six import iteritems ; for KEY, VALUE in iteritems(DICT):' - echo ' from ansible.compat.six import iteritems ; for KEY, VALUE in iteritems(DICT):' echo "${ITERITEMS_USERS}" exit 1 fi diff --git a/test/sanity/code-smell/no-dict-itervalues.sh b/test/sanity/code-smell/no-dict-itervalues.sh index 7a7494860f..ed388125fa 100755 --- a/test/sanity/code-smell/no-dict-itervalues.sh +++ b/test/sanity/code-smell/no-dict-itervalues.sh @@ -6,8 +6,7 @@ ITERVALUES_USERS=$(grep -rI '\.itervalues' . \ --exclude-dir docsite \ | grep -v \ -e 'six\.itervalues' \ - -e lib/ansible/compat/six/_six.py \ - -e lib/ansible/module_utils/six.py \ + -e lib/ansible/module_utils/six/_six.py \ -e test/sanity/code-smell/no-dict-itervalues.sh \ ) @@ -15,7 +14,6 @@ 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 ' from ansible.compat.six import itervalues ; for VALUE in itervalues(DICT):' echo "${ITERVALUES_USERS}" exit 1 fi diff --git a/test/sanity/code-smell/no-iterkeys.sh b/test/sanity/code-smell/no-iterkeys.sh index 7323309ec8..2c53398e05 100755 --- a/test/sanity/code-smell/no-iterkeys.sh +++ b/test/sanity/code-smell/no-iterkeys.sh @@ -7,8 +7,7 @@ ITERKEYS_USERS=$(grep -r -I iterkeys . \ --exclude-dir docsite \ --exclude-dir results \ | grep -v \ - -e lib/ansible/compat/six/_six.py \ - -e lib/ansible/module_utils/six.py \ + -e lib/ansible/module_utils/six/_six.py \ -e test/sanity/code-smell/no-iterkeys.sh \ -e '^[^:]*:#' ) diff --git a/test/sanity/code-smell/replace-urlopen.sh b/test/sanity/code-smell/replace-urlopen.sh index 6bd0f6ee8c..a2ff60ba04 100755 --- a/test/sanity/code-smell/replace-urlopen.sh +++ b/test/sanity/code-smell/replace-urlopen.sh @@ -3,8 +3,7 @@ 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 '^\./lib/ansible/module_utils/six/_six.py:' \ -e '^[^:]*:#' ) diff --git a/test/sanity/code-smell/use-compat-six.sh b/test/sanity/code-smell/use-compat-six.sh index c77ad7c7ec..d81b8f4ca4 100755 --- a/test/sanity/code-smell/use-compat-six.sh +++ b/test/sanity/code-smell/use-compat-six.sh @@ -10,8 +10,8 @@ WHITELIST='(lib/ansible/modules/cloud/digital_ocean/digital_ocean.py)' SIX_USERS=$(find "$BASEDIR" -name '*.py' -exec grep -wH six '{}' '+' \ | grep import \ - | grep -v ansible.compat \ | grep -v ansible.module_utils.six \ + | grep -v 'ansible.module_utils import six' \ | egrep -v "^$WHITELIST:" ) |