Bug 949855 - Fail to import job with device != driver="some driver"
Summary: Fail to import job with device != driver="some driver"
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 0.11
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 19.1
Assignee: Dan Callaghan
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-09 07:48 UTC by Amit Saha
Modified: 2018-02-06 00:41 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-17 08:40:09 UTC
Embargoed:


Attachments (Terms of Use)

Description Amit Saha 2013-04-09 07:48:04 UTC
Description of problem:

A Job with a device specification such as:

<device op="!=" driver="some-driver"/>

fails with:

Failed to import job because of: "Error in hostRequires: Neither 'InstrumentedAttribute' object nor 'Comparator' object has an attribute '__equal__'"


Sample job:

<job retention_tag="120days">
	<whiteboard>
		Testing Device specification
	</whiteboard>
	<recipeSet priority="High">
		<recipe kernel_options="" kernel_options_post="" ks_meta="" role="None" whiteboard="">
			<autopick random="false"/>
			<watchdog panic="ignore"/>
			<packages/>
			<ks_appends/>
			<repos/>
			<distroRequires>
				<and>
					<distro_family op="=" value="RedHatEnterpriseLinux6"/>
					<distro_variant op="=" value="Workstation"/>
					<distro_name op="=" value="RHEL6.4-20130130.0"/>
					<distro_arch op="=" value="x86_64"/>
				</and>
			</distroRequires>
			<hostRequires>
				<and>
	                                <system_type op="=" value="Machine"/>
                                        <device op="!=" driver="pcieport-driver"/> 
				</and>
			</hostRequires>
			<partitions/>
			<task name="/distribution/install" role="STANDALONE">
				<params/>
			</task>
			<task name="/distribution/reservesys" role="STANDALONE">
				<params>
					<param name="RESERVETIME" value="86400"/>
				</params>
			</task>
		</recipe>
	</recipeSet>
</job>


In my preliminary tests, it seems to be only "driver" attribute that demonstrates this bug. Something like this succeeds:

<device op="!=" type="USB" />


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Submit sample job
2. 
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 Dan Callaghan 2014-11-20 07:59:47 UTC
Traceback (most recent call last):
  File "/home/dcallagh/work/beaker/Server/bkr/server/jobs.py", line 393, in clone
    job = self.process_xmljob(xmljob,identity.current.user)
  File "/home/dcallagh/work/beaker/Server/bkr/server/jobs.py", line 519, in process_xmljob
    ignore_missing_tasks=ignore_missing_tasks)
  File "/home/dcallagh/work/beaker/Server/bkr/server/jobs.py", line 438, in _handle_recipe_set
    ignore_missing_tasks=ignore_missing_tasks)
  File "/home/dcallagh/work/beaker/Server/bkr/server/jobs.py", line 585, in handleRecipe
    systems = XmlHost.from_string(recipe.host_requires).apply_filter(System.query)
  File "/home/dcallagh/work/beaker/Server/bkr/server/needpropertyxml.py", line 127, in apply_filter
    query, clause = self.filter(query)
  File "/home/dcallagh/work/beaker/Server/bkr/server/needpropertyxml.py", line 155, in filter
    (joins, query) = child.filter(joins)
  File "/home/dcallagh/work/beaker/Server/bkr/server/needpropertyxml.py", line 155, in filter
    (joins, query) = child.filter(joins)
  File "/home/dcallagh/work/beaker/Server/bkr/server/needpropertyxml.py", line 974, in filter
    filter_clauses.append(getattr(getattr(Device, attr),equal)(value))
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/attributes.py", line 270, in __getattr__
    key)

Comment 3 Dan Callaghan 2014-11-24 00:36:27 UTC
http://gerrit.beaker-project.org/3501

Comment 6 Dan Callaghan 2014-12-17 08:40:09 UTC
Beaker 19.1 is released.


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