def import_no_db_in_virt(logical_line, filename):
    """Check for db calls from nova/virt

    As of grizzly-2 all the database calls have been removed from
    nova/virt, and we want to keep it that way.

    N307
    """
    if 'nova/virt' in filename and not filename.endswith('fake.py'):
        if logical_line.startswith('from nova.db import api'):
            yield 0, 'N307: nova.db.api import not allowed in nova/virt/*'
