Description of problem: Put an invalid key_value entry in hostrequires and it will produce an empty where clause which will cause the query to fail. Version-Release number of selected component (if applicable): 0.8.2 How reproducible: 100% with the right recipe. Steps to Reproduce: 1. put the following in <hostRequires> <key_value key="system_type" op="=" value="Machine"/>
Seems the only way to reproduce this is to filter on two non-existent keys joined by an <and/>: <hostRequires> <and> <key_value key="NOTEXIST1" op="=" value="asdf"/> <key_value key="NOTEXIST2" op="=" value="asdf"/> </and> </hostRequires> It doesn't happen if one of the keys does exist, or if there is only one <key_value/> filter in the <and/>.
I guess this is why: >>> print System.query.filter(and_(None)).filter(System.private == False) SELECT ... FROM system WHERE system.private = %s >>> print System.query.filter(and_(None, None)).filter(System.private == False) SELECT ... FROM system WHERE AND system.private = %s
On Gerrit: http://gerrit.beaker-project.org/1085
Beaker 0.9.0 has been released.