Running pep8 checks with ./run_tests.sh --pep8 results in ERROR messages
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Joe Gordon |
Bug Description
Running "./run_tests.sh --pep8" results in the following messages:
Running PEP8 and HACKING compliance check...
Libvirt module could not be loaded. NWFilterFirewall will not work correctly.
ERROR: import 'import libvirt' failed: No module named libvirt
ERROR: import 'import qpid' failed: No module named qpid
ERROR: import 'from nova.rpc import impl_qpid' failed: No module named qpid.messaging
ERROR: import 'import qpid.messaging' failed: No module named qpid.messaging
ERROR: import 'import qpid.messaging.
ERROR: import 'import libvirt' failed: No module named libvirt
ERROR: import 'import win32console as win' failed: No module named win32console
ERROR: import 'import win32console' failed: No module named win32console
ERROR: import 'import pywintypes' failed: No module named pywintypes
ERROR: import 'import rabbit' failed: No module named rabbit
ERROR: import 'import bpython' failed: No module named bpython
ERROR: import 'import IPython' failed: No module named IPython
ERROR: import 'import win32com.client' failed: No module named win32com.client
ERROR: import 'import simplejson as json' failed: No module named simplejson
tools/hacking.
__import__(mod, globals(), locals(), [], -1)
ERROR: import 'import XenAPIPlugin' failed: No module named XenAPIPlugin
ERROR: import 'import XenAPIPlugin' failed: No module named XenAPIPlugin
ERROR: import 'import simplejson as json' failed: No module named simplejson
ERROR: import 'import XenAPIPlugin' failed: No module named XenAPIPlugin
ERROR: import 'import simplejson as json' failed: No module named simplejson
ERROR: import 'import XenAPIPlugin' failed: No module named XenAPIPlugin
ERROR: import 'import simplejson as json' failed: No module named simplejson
ERROR: import 'import XenAPIPlugin' failed: No module named XenAPIPlugin
ERROR: import 'import xenstore' failed: No module named XenAPIPlugin
ERROR: import 'import simplejson as json' failed: No module named simplejson
ERROR: import 'import simplejson as json' failed: No module named simplejson
Based on the DeprecationWarning emitted in the middle there, I suspect that this is specifically the checks against HACKING, implemented by tools/hacking.py. That file includes tests to ensure that imports are importing modules, rather than objects from modules, and would attempt each import discovered in all of nova; however, it would appear that it is not intercepting error messages about missing imports. As some of our imports are expected to potentially not be present, it should catch these messages and not emit them.
For the DeprecationWarning, by the way, there is a convenient way of inhibiting warnings by using the catch_warnings context manager from the warnings module.
Changed in nova: | |
assignee: | nobody → Dan Prince (dan-prince) |
status: | New → In Progress |
importance: | Undecided → Low |
Changed in nova: | |
assignee: | Dan Prince (dan-prince) → Joe Gordon (joe-gordon0) |
Changed in nova: | |
milestone: | none → folsom-1 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | folsom-1 → 2012.2 |
Fix proposed to branch: master/review.openstack.org/6706
Review: https:/