From aadd09fd2459027036b85df395f33aeb12a99ad5 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Wed, 27 Jun 2012 22:52:41 +0000 Subject: [PATCH] Add PEP8 checks back for Dom0 plugins. Fixes bug 1018641 Change-Id: Id61947252fe4d3f5b93279518128ba90100f3748 --- run_tests.sh | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index c814b1adf..f61979e0d 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -98,27 +98,30 @@ function run_tests { return $RESULT } -# Files of interest -# NOTE(lzyeval): Avoid selecting nova-api-paste.ini and nova.conf in nova/bin -# when running on devstack. -# NOTE(lzyeval): Avoid selecting *.pyc files to reduce pep8 check-up time -# when running on devstack. -# NOTE(dprince): Exclude xenapi plugins. They are Python 2.4 code and as such -# cannot be expected to work with tools/hacking checks. -xen_net_path="plugins/xenserver/networking/etc/xensource/scripts" -srcfiles=`find nova -type f -name "*.py"` -srcfiles+=" `find bin -type f ! -name "nova.conf*" ! -name "*api-paste.ini*"`" -srcfiles+=" `find tools -type f -name "*.py"`" -srcfiles+=" setup.py" function run_pep8 { echo "Running PEP8 and HACKING compliance check..." - # Just run PEP8 in current environment - # + + # Files of interest + # NOTE(lzyeval): Avoid selecting nova-api-paste.ini and nova.conf in nova/bin + # when running on devstack. + # NOTE(lzyeval): Avoid selecting *.pyc files to reduce pep8 check-up time + # when running on devstack. + srcfiles=`find nova -type f -name "*.py"` + srcfiles+=" `find bin -type f ! -name "nova.conf*" ! -name "*api-paste.ini*"`" + srcfiles+=" `find tools -type f -name "*.py"`" + srcfiles+=" setup.py" # Until all these issues get fixed, ignore. ignore='--ignore=N4' + ${wrapper} python tools/hacking.py ${ignore} ${srcfiles} + + # NOTE(sirp): Dom0 plugins are written for Python 2.4, meaning some HACKING + # checks are too strict. + pep8onlyfiles=`find plugins -type f -name "*.py"` + pep8onlyfiles+=" `find plugins/xenserver/xenapi/etc/xapi.d/plugins/ -type f -executable`" + ${wrapper} pep8 ${pep8onlyfiles} }