checkbox resource evaluator has non-obvious behavior for the membership test operator
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Checkbox |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
In theory, Checkbox should happily parse the python statements contained in job descriptions when setting up requirements like this:
package.name == 'Foo'
or
dmi.product not in ['Laptop', 'Notebook', 'Portable']
However, that second one does not work. The opposite form of that statement:
dmi.product in ['Laptop', 'Notebook', 'Portable']
Does work fine, but for some reason, when checkbox parses the 'not in' version, it fails to properly work.
This was observed as the root cause of bug #1116681
Where I had use the 'not in' syntax for a requirement. To fix that bug, I changed the requires to a format known to work. For the root cause, Ive opened this bug to address the actual requirements parsing in checkbox
For convenience, here's the text of the other bug: /certification. canonical. com/hardware/ 201302- 12676/submissio n/i0ryyDGuuBim1 9Y/result/ test:monitor% 252Fmulti- head:__ monitor_ _
For the actual result:
https:/
This test has the constraint: dmi.product not in ['Notebook' ,'Laptop' ,'Portable' ]
It appears that this is not working correctly. DMI clearly shows the system to be a "Desktop" chassis type:
Handle 0x0003, DMI type 3, 22 bytes
Chassis Information
Manufacturer: Gigabyte Technology Co., Ltd.
Type: Desktop
Lock: Not Present
Version: To Be Filled By O.E.M.
Serial Number: To Be Filled By O.E.M.
Asset Tag: To Be Filled By O.E.M.
Boot-up State: Safe
Power Supply State: Safe
Thermal State: Safe
Security Status: None
OEM Information: 0x00000000
Height: Unspecified
Number Of Power Cords: 1
Contained Elements: 0
SKU Number: To be filled by O.E.M.
so perhaps something is broken with the dmi interpreter (dmi.py) or the bits that interpret the requires are not honoring the python statement.