'NoneType' object has no attribute '__getitem__'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bandit |
Fix Released
|
High
|
Sean McGinnis |
Bug Description
Running bandit analysis against the cinder code base I am getting many of the following output:
[tester] ERROR Bandit internal error running: try_except_pass on file cinder/
File "/home/
result = test(context, test_config)
File "/home/
if (not config[
TypeError: 'NoneType' object has no attribute '__getitem__'
It appears config is not being passed in by takes_config.
Other plugins using takes_config do not show this error, just try_except_pass. The other plugins also appear to be importing and declaring the decorator slightly different.
I found switching the import to match some of the other ones or keeping the import as is but adding parenthesis to the decorator makes the problem go away. Not sure how these really make a difference.
Using Python 2.7.6 on Ubuntu 14.01.
Changed in bandit: | |
assignee: | nobody → Sean McGinnis (sean-mcginnis) |
status: | New → In Progress |
Changed in bandit: | |
importance: | Undecided → High |
Fix proposed to branch: master /review. openstack. org/209679
Review: https:/