This will happen on systems that report more than 1 graphics card (i.e. Hybrid systems with both drivers installed).
To reproduce:
- Copy /usr/share/checkbox/scripts/graphics_driver to /tmp
- Modify the copy on /tmp so that line 304 reads:
has_hybrid_graphics = (len(cards) >= 1 and hybrid.is_laptop()
(the change is changing > for >= so that this condition is met on any system).
- Run the script from /tmp
Expected result:
- Graphics driver information
Actual result:
------------- VIDEO DRIVER INFORMATION -------------
Video Driver: intel
Driver Version: 2.17.0
------------- HYBRID GRAPHICS CHECK ----------------
Graphics Chipset: Intel (8086:0046)
Loaded DDX Drivers: intel, vesa, fbdev, fbdevhw
Traceback (most recent call last):
File "Documents/checkboxes/checkbox/trunk/scripts/graphics_driver", line 323, in <module>
sys.exit(main())
File "Documents/checkboxes/checkbox/trunk/scripts/graphics_driver", line 318, in main
results.append(hybrid_graphics_check(xlog))
File "Documents/checkboxes/checkbox/trunk/scripts/graphics_driver", line 304, in hybrid_graphics_check
has_hybrid_graphics = (len(cards) >= 1 and hybrid.is_laptop()
NameError: global name 'hybrid' is not defined
The problem is that the "hybrid" object on which is_laptop and cards_dict are being called does not exist. is_laptop() is just a method so it probably doesn't need to be scoped to hybrid, and cards_dict is a local variable in the hybrid_graphics_check method so it also probably needs no scoping.
Setting to Triaged with importance: Medium, as people running this on hybrid graphics systems (which are becoming more popular) will very likely run into this.
This will happen on systems that report more than 1 graphics card (i.e. Hybrid systems with both drivers installed).
To reproduce:
- Copy /usr/share/ checkbox/ scripts/ graphics_ driver to /tmp
- Modify the copy on /tmp so that line 304 reads:
has_ hybrid_ graphics = (len(cards) >= 1 and hybrid.is_laptop()
(the change is changing > for >= so that this condition is met on any system).
- Run the script from /tmp
Expected result:
- Graphics driver information
Actual result:
------------- VIDEO DRIVER INFORMATION -------------
Video Driver: intel
Driver Version: 2.17.0
------------- HYBRID GRAPHICS CHECK ---------------- checkboxes/ checkbox/ trunk/scripts/ graphics_ driver" , line 323, in <module> exit(main( )) checkboxes/ checkbox/ trunk/scripts/ graphics_ driver" , line 318, in main append( hybrid_ graphics_ check(xlog) ) checkboxes/ checkbox/ trunk/scripts/ graphics_ driver" , line 304, in hybrid_ graphics_ check hybrid_ graphics = (len(cards) >= 1 and hybrid.is_laptop()
Graphics Chipset: Intel (8086:0046)
Loaded DDX Drivers: intel, vesa, fbdev, fbdevhw
Traceback (most recent call last):
File "Documents/
sys.
File "Documents/
results.
File "Documents/
has_
NameError: global name 'hybrid' is not defined
The problem is that the "hybrid" object on which is_laptop and cards_dict are being called does not exist. is_laptop() is just a method so it probably doesn't need to be scoped to hybrid, and cards_dict is a local variable in the hybrid_ graphics_ check method so it also probably needs no scoping.
Setting to Triaged with importance: Medium, as people running this on hybrid graphics systems (which are becoming more popular) will very likely run into this.