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

def import_no_db_in_virt ( logical_line , filename ) : if ( ( 'nova/virt' in filename ) and ( not filename . endswith ( 'fake.py' ) ) ) : if logical_line . startswith ( 'from nova import db' ) : ( yield ( 0 , 'N307: nova.db import not allowed in nova/virt/*' ) )
check for db calls from nova/virt as of grizzly-2 all the database calls have been removed from nova/virt .