From 49f2b84253ba6add48cc15493d0db03df075774c Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Fri, 16 Oct 2015 10:31:35 -0700 Subject: [PATCH] Add a code smell test to make sure we're not using the raw system six (So we know we have a recent enough version) --- test/code-smell/use-compat-six.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 test/code-smell/use-compat-six.sh diff --git a/test/code-smell/use-compat-six.sh b/test/code-smell/use-compat-six.sh new file mode 100755 index 0000000000..663d527977 --- /dev/null +++ b/test/code-smell/use-compat-six.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Do we want to check dynamic inventory, bin, etc? +BASEDIR=${1-"lib"} + +SIX_USERS=$(find "$BASEDIR" -name '*.py' -exec grep -H six \{\} \;|grep import |grep -v ansible.compat) +if test -n "$SIX_USERS" ; then + printf "$SIX_USERS" + exit 1 +else + exit 0 +fi