2015-10-20 03:39:15 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-11-08 01:46:33 +01:00
|
|
|
metaclass1=$(find ./bin -type f -exec grep -HL '__metaclass__ = type' '{}' '+')
|
|
|
|
future1=$(find ./bin -type f -exec grep -HL 'from __future__ import (absolute_import, division, print_function)' '{}' '+')
|
2015-10-20 03:39:15 +02:00
|
|
|
|
2016-12-06 17:29:16 +01:00
|
|
|
metaclass2=$(find ./lib/ansible -path ./lib/ansible/modules -prune \
|
2015-10-20 03:39:15 +02:00
|
|
|
-o -path ./lib/ansible/module_utils -prune \
|
2017-03-23 21:35:05 +01:00
|
|
|
-o -path ./lib/ansible/module_utils/six/_six.py -prune \
|
2017-02-01 17:48:23 +01:00
|
|
|
-o -path ./lib/ansible/compat/selectors/_selectors2.py -prune \
|
2015-10-20 03:39:15 +02:00
|
|
|
-o -path ./lib/ansible/utils/module_docs_fragments -prune \
|
2017-07-28 23:15:23 +02:00
|
|
|
-o -name '*.py' -type f -size +0c -exec grep -HL '__metaclass__ = type' '{}' '+')
|
2015-10-20 03:39:15 +02:00
|
|
|
|
2016-12-06 17:29:16 +01:00
|
|
|
future2=$(find ./lib/ansible -path ./lib/ansible/modules -prune \
|
2015-10-20 03:39:15 +02:00
|
|
|
-o -path ./lib/ansible/module_utils -prune \
|
2017-03-23 21:35:05 +01:00
|
|
|
-o -path ./lib/ansible/module_utils/six/_six.py -prune \
|
2017-02-01 17:48:23 +01:00
|
|
|
-o -path ./lib/ansible/compat/selectors/_selectors2.py -prune \
|
2015-10-20 03:39:15 +02:00
|
|
|
-o -path ./lib/ansible/utils/module_docs_fragments -prune \
|
2017-07-28 23:15:23 +02:00
|
|
|
-o -name '*.py' -type f -size +0c -exec grep -HL 'from __future__ import (absolute_import, division, print_function)' '{}' '+')
|
|
|
|
|
|
|
|
# Eventually we want metaclass3 and future3 to get down to 0
|
|
|
|
metaclass3=$(find ./lib/ansible/modules -path ./lib/ansible/modules/windows -prune \
|
|
|
|
-o -path ./lib/ansible/modules/source_control -prune \
|
|
|
|
-o -path ./lib/ansible/modules/packaging -prune \
|
|
|
|
-o -path ./lib/ansible/modules/notification -prune \
|
|
|
|
-o -path ./lib/ansible/modules/network -prune \
|
|
|
|
-o -path ./lib/ansible/modules/net_tools -prune \
|
|
|
|
-o -path ./lib/ansible/modules/monitoring -prune \
|
|
|
|
-o -path ./lib/ansible/modules/identity -prune \
|
|
|
|
-o -path ./lib/ansible/modules/files -prune \
|
|
|
|
-o -path ./lib/ansible/modules/database -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/vmware -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/rackspace -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/ovirt -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/openstack -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/misc -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/google -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/cloudstack -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/centurylink -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/amazon -prune \
|
|
|
|
-o -name '*.py' -type f -size +0c -exec grep -HL '__metaclass__ = type' '{}' '+')
|
|
|
|
|
|
|
|
future3=$(find ./lib/ansible/modules -path ./lib/ansible/modules/windows -prune \
|
|
|
|
-o -path ./lib/ansible/modules/source_control -prune \
|
|
|
|
-o -path ./lib/ansible/modules/packaging -prune \
|
|
|
|
-o -path ./lib/ansible/modules/notification -prune \
|
|
|
|
-o -path ./lib/ansible/modules/network -prune \
|
|
|
|
-o -path ./lib/ansible/modules/net_tools -prune \
|
|
|
|
-o -path ./lib/ansible/modules/monitoring -prune \
|
|
|
|
-o -path ./lib/ansible/modules/identity -prune \
|
|
|
|
-o -path ./lib/ansible/modules/files -prune \
|
|
|
|
-o -path ./lib/ansible/modules/database -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/vmware -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/rackspace -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/ovirt -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/openstack -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/misc -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/google -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/cloudstack -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/centurylink -prune \
|
|
|
|
-o -path ./lib/ansible/modules/cloud/amazon -prune \
|
|
|
|
-o -name '*.py' -type f -size +0c -exec egrep -HL 'from __future__ import (?absolute_import, division, print_function)?' '{}' '+')
|
2015-10-20 03:39:15 +02:00
|
|
|
|
2017-07-29 09:20:36 +02:00
|
|
|
# Ordered by approximate work, lowest to highest
|
|
|
|
# cloud/misc
|
|
|
|
# cloud/google
|
|
|
|
# identity
|
|
|
|
# cloud/source_control
|
|
|
|
# cloud/centurylink
|
|
|
|
# database ;; break up
|
|
|
|
# net-tools
|
|
|
|
# cloud/rackspace
|
|
|
|
# cloud/vmware
|
|
|
|
# files
|
|
|
|
# cloud/openstack
|
|
|
|
# monitoring
|
|
|
|
# cloud/notification
|
|
|
|
# cloud/cloudstack
|
|
|
|
# cloud/ovirt
|
|
|
|
# cloud/packaging ;; breakup
|
|
|
|
# cloud/amazon
|
|
|
|
# network ;; break up
|
2015-10-20 03:39:15 +02:00
|
|
|
### TODO:
|
2017-07-28 23:15:23 +02:00
|
|
|
### - module_utils
|
2017-07-29 09:20:36 +02:00
|
|
|
### - contrib/
|
2015-10-20 03:39:15 +02:00
|
|
|
|
|
|
|
|
2017-07-28 23:15:23 +02:00
|
|
|
if test -n "$metaclass1" -o -n "$metaclass2" -o -n "$metaclass3" ; then
|
2015-10-20 03:39:15 +02:00
|
|
|
printf "\n== Missing __metaclass__ = type ==\n"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n "$metaclass1" ; then
|
|
|
|
printf "$metaclass1\n"
|
|
|
|
fi
|
|
|
|
if test -n "$metaclass2" ; then
|
|
|
|
printf "$metaclass2\n"
|
|
|
|
fi
|
2017-07-28 23:15:23 +02:00
|
|
|
if test -n "$metaclass3" ; then
|
|
|
|
printf "$metaclass3\n"
|
|
|
|
fi
|
2015-10-20 03:39:15 +02:00
|
|
|
|
2017-07-28 23:15:23 +02:00
|
|
|
if test -n "$future1" -o -n "$future2" -o -n "$future3" ; then
|
2015-10-20 03:39:15 +02:00
|
|
|
printf "\n== Missing from __future__ import (absolute_import, division, print_function) ==\n"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n "$future1" ; then
|
|
|
|
printf "$future1\n"
|
|
|
|
fi
|
|
|
|
if test -n "$future2" ; then
|
|
|
|
printf "$future2\n"
|
|
|
|
fi
|
2017-07-28 23:15:23 +02:00
|
|
|
if test -n "$future3" ; then
|
|
|
|
printf "$future3\n"
|
|
|
|
fi
|
2015-10-20 03:39:15 +02:00
|
|
|
|
2017-07-28 23:15:23 +02:00
|
|
|
if test -n "$future1$future2$future3$metaclass1$metaclass2$metaclass3" ; then
|
|
|
|
failures=$(printf "$future1$future2$future3$metaclass1$metaclass2$metaclass3"| wc -l)
|
2015-10-20 03:39:15 +02:00
|
|
|
failures=$(expr $failures + 2)
|
|
|
|
exit $failures
|
|
|
|
fi
|
|
|
|
exit 0
|