Merge "Fix hacking tests on osx"
This commit is contained in:
commit
9d9bed9e68
@ -48,7 +48,8 @@ logging.disable('LOG')
|
|||||||
|
|
||||||
IMPORT_EXCEPTIONS = ['sqlalchemy', 'migrate', 'nova.db.sqlalchemy.session',
|
IMPORT_EXCEPTIONS = ['sqlalchemy', 'migrate', 'nova.db.sqlalchemy.session',
|
||||||
'nova.openstack.common.log.logging',
|
'nova.openstack.common.log.logging',
|
||||||
'nova.db.sqlalchemy.migration.versioning_api']
|
'nova.db.sqlalchemy.migration.versioning_api', 'paste']
|
||||||
|
# Paste is missing a __init__ in top level directory
|
||||||
START_DOCSTRING_TRIPLE = ['u"""', 'r"""', '"""', "u'''", "r'''", "'''"]
|
START_DOCSTRING_TRIPLE = ['u"""', 'r"""', '"""', "u'''", "r'''", "'''"]
|
||||||
END_DOCSTRING_TRIPLE = ['"""', "'''"]
|
END_DOCSTRING_TRIPLE = ['"""', "'''"]
|
||||||
VERBOSE_MISSING_IMPORT = os.getenv('HACKING_VERBOSE_MISSING_IMPORT', 'False')
|
VERBOSE_MISSING_IMPORT = os.getenv('HACKING_VERBOSE_MISSING_IMPORT', 'False')
|
||||||
@ -187,9 +188,12 @@ def nova_import_rules(logical_line):
|
|||||||
# pass the doctest, since the relativity depends on the file's locality
|
# pass the doctest, since the relativity depends on the file's locality
|
||||||
|
|
||||||
def is_module_for_sure(mod, search_path=sys.path):
|
def is_module_for_sure(mod, search_path=sys.path):
|
||||||
mod_path = mod.replace('.', os.sep)
|
|
||||||
try:
|
try:
|
||||||
imp.find_module(mod_path, search_path)
|
while '.' in mod:
|
||||||
|
pack_name, _sep, mod = mod.partition('.')
|
||||||
|
f, p, d = imp.find_module(pack_name, search_path)
|
||||||
|
search_path = [p]
|
||||||
|
imp.find_module(mod, search_path)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
# This is used by run_tests.sh and tox.ini
|
# This is used by run_tests.sh and tox.ini
|
||||||
python tools/hacking.py --doctest
|
python tools/hacking.py --doctest
|
||||||
|
|
||||||
@ -12,7 +14,7 @@ ${PEP8} ${EXCLUDE} .
|
|||||||
|
|
||||||
${PEP8} --filename=nova* bin
|
${PEP8} --filename=nova* bin
|
||||||
|
|
||||||
SCRIPT_ROOT=$(echo $(dirname $(readlink -f "$0")) | sed s/\\/tools//)
|
SCRIPT_ROOT=$(echo $(cd "$(dirname $0)"; pwd) | sed s/\\/tools//)
|
||||||
|
|
||||||
SCRIPTS_PATH=${SCRIPT_ROOT}/plugins/xenserver/networking/etc/xensource/scripts
|
SCRIPTS_PATH=${SCRIPT_ROOT}/plugins/xenserver/networking/etc/xensource/scripts
|
||||||
PYTHONPATH=${SCRIPTS_PATH} ${PEP8} ./plugins/xenserver/networking
|
PYTHONPATH=${SCRIPTS_PATH} ${PEP8} ./plugins/xenserver/networking
|
||||||
@ -20,6 +22,6 @@ PYTHONPATH=${SCRIPTS_PATH} ${PEP8} ./plugins/xenserver/networking
|
|||||||
# NOTE(sirp): Also check Dom0 plugins w/o .py extension
|
# NOTE(sirp): Also check Dom0 plugins w/o .py extension
|
||||||
PLUGINS_PATH=${SCRIPT_ROOT}/plugins/xenserver/xenapi/etc/xapi.d/plugins
|
PLUGINS_PATH=${SCRIPT_ROOT}/plugins/xenserver/xenapi/etc/xapi.d/plugins
|
||||||
PYTHONPATH=${PLUGINS_PATH} ${PEP8} ./plugins/xenserver/xenapi \
|
PYTHONPATH=${PLUGINS_PATH} ${PEP8} ./plugins/xenserver/xenapi \
|
||||||
`find plugins/xenserver/xenapi/etc/xapi.d/plugins/ -type f -perm +111`
|
`find plugins/xenserver/xenapi/etc/xapi.d/plugins -type f -perm +111`
|
||||||
|
|
||||||
! pyflakes nova/ | grep "imported but unused"
|
! pyflakes nova/ | grep "imported but unused"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user