Fixed undefined names
Merge with upstream repo
Merge pull request #523 from vi4m/cmdb_fixes_undefined_names

Fixed undefined names from pyflakes