Bug 875535

Summary: CPU flag filtering in hostRequires does not work
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: schedulerAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: Qixiang Wan <qwan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.9CC: asaha, dcallagh, mishin, qwan, rglasz, rmancy
Target Milestone: 0.11   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: UX
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-17 04:35:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Callaghan 2012-11-11 23:55:49 UTC
The CpuFlag class in bkr.server.needpropertyxml has two typos which prevent the use of <cpu><flag/></cpu> (or <cpu_flag/>) in hostRequires.

Traceback (most recent call last):
  File "/home/dcallagh/work/beaker/IntegrationTests/src/bkr/inttest/server/test_model.py", line 949, in test_cpu_flags
    """))
  File "/home/dcallagh/work/beaker/Server/bkr/server/model.py", line 3045, in systems_filter
    systems = apply_system_filter(filter, systems)
  File "/home/dcallagh/work/beaker/Server/bkr/server/needpropertyxml.py", line 907, in apply_system_filter
    (query, clause) = child.filter(query)
  File "/home/dcallagh/work/beaker/Server/bkr/server/needpropertyxml.py", line 105, in filter
    (joins, query) = child.filter(joins)
  File "/home/dcallagh/work/beaker/Server/bkr/server/needpropertyxml.py", line 725, in filter
    value = self.get_xml_attr('value', int, None)
  File "/home/dcallagh/work/beaker/Server/bkr/server/needpropertyxml.py", line 81, in get_xml_attr
    return typeCast(attributes[attr])
ValueError: invalid literal for int() with base 10: 'vmx'

Traceback (most recent call last):
  File "/home/dcallagh/work/beaker/IntegrationTests/src/bkr/inttest/server/test_model.py", line 949, in test_cpu_flags
    """))
  File "/home/dcallagh/work/beaker/Server/bkr/server/model.py", line 3045, in systems_filter
    systems = apply_system_filter(filter, systems)
  File "/home/dcallagh/work/beaker/Server/bkr/server/needpropertyxml.py", line 907, in apply_system_filter
    (query, clause) = child.filter(query)
  File "/home/dcallagh/work/beaker/Server/bkr/server/needpropertyxml.py", line 105, in filter
    (joins, query) = child.filter(joins)
  File "/home/dcallagh/work/beaker/Server/bkr/server/needpropertyxml.py", line 729, in filter
    query = getattr(CpuFlag.flag, equal)(value)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/attributes.py", line 143, in __getattr__
    key)
AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' object has an attribute '__equal__'

Comment 1 Dan Callaghan 2012-11-11 23:59:51 UTC
On Gerrit: http://gerrit.beaker-project.org/1484

Comment 4 Qixiang Wan 2012-12-26 05:38:47 UTC
Verified with build beaker-0.10.6-1.git.95.9d3b913.el6.

The original issue is solved by the fix, however there is another issue found in cpu flag filtering, 'like' op doesn't work, I opened a new bug as Bug 890261.

Comment 5 Dan Callaghan 2013-01-17 04:35:03 UTC
Beaker 0.11.0 has been released.