summaryrefslogtreecommitdiffstats
path: root/git/pylint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git/pylint.sh')
-rwxr-xr-xgit/pylint.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/git/pylint.sh b/git/pylint.sh
index 86ea52d45..3acf9cc8c 100755
--- a/git/pylint.sh
+++ b/git/pylint.sh
@@ -7,15 +7,18 @@ ANSIBLE_UPSTREAM_FILES=(
'inventory/libvirt/hosts/libvirt_generic.py'
'inventory/openstack/hosts/nova.py'
'lookup_plugins/sequence.py'
+ 'playbooks/gce/openshift-cluster/library/gce.py'
)
OLDREV=$1
NEWREV=$2
#TRG_BRANCH=$3
-PYTHON=/var/lib/jenkins/python27/bin/python
+PYTHON=$(which python)
+set +e
PY_DIFF=$(/usr/bin/git diff --name-only $OLDREV $NEWREV --diff-filter=ACM | grep ".py$")
+set -e
FILES_TO_TEST=""
@@ -38,7 +41,11 @@ for PY_FILE in $PY_DIFF; do
fi
done
+export PYTHONPATH=${WORKSPACE}/utils/src/:${WORKSPACE}/utils/test/
+
if [ "${FILES_TO_TEST}" != "" ]; then
echo "Testing files: ${FILES_TO_TEST}"
- ${PYTHON} -m pylint --rcfile ${WORKSPACE}/git/.pylintrc ${FILES_TO_TEST}
+ exec ${PYTHON} -m pylint --rcfile ${WORKSPACE}/git/.pylintrc ${FILES_TO_TEST}
+else
+ exit 0
fi