pep8 returns false N302 for missing import

Bug #1133103 reported by Joe Gordon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Joe Gordon

Bug Description

The pep8 for patch set 6 of https://review.openstack.org/#/c/22707 returned invalid results. http://logs.openstack.org/22707/6/check/gate-nova-pep8/21479/console.html.gz

pep8 reported
'./nova/virt/vmwareapi/vim.py:32:1: N302 import only modules.'from nova.virt.vmwareapi import error_util' does not import a module'

 because https://review.openstack.org/#/c/22707/6..7/nova/openstack/common/db/exception.py
 had in invalid import.

The current logic compares the last word of the module name along with the last word of the exception msg, and if they are not the same a module is missing. This check should also make sure the words "cannot import" aren't in the exception msg.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/22947

Changed in nova:
assignee: nobody → Joe Gordon (jogo)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/22947
Committed: http://github.com/openstack/nova/commit/99308d4dd3b16e00af4e610be4f07c7d99e49846
Submitter: Jenkins
Branch: master

commit 99308d4dd3b16e00af4e610be4f07c7d99e49846
Author: Joe Gordon <email address hidden>
Date: Mon Feb 25 19:44:29 2013 -0800

    Fix hacking.py to handle 'cannot import x'

    Fix missingImport logic to handle a module that cannot be imported, due
    to a missing dependant module.

    Due to the nature of this bug doctests cannot cover it.

    Fix bug 1133103

    Change-Id: Ia067bacc125b67e2d9e0cfc72495e4f13a8648ad

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.