Bug 875535 - CPU flag filtering in hostRequires does not work
Summary: CPU flag filtering in hostRequires does not work
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 0.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 0.11
Assignee: Dan Callaghan
QA Contact: Qixiang Wan
URL:
Whiteboard: UX
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-11 23:55 UTC by Dan Callaghan
Modified: 2018-02-06 00:41 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-01-17 04:35:03 UTC
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.