Version-Release number of selected component (if applicable): 22.0 Steps to Reproduce: 1. Submit a job with <hostRequires/> like this: <hostRequires> <and> <hostname op="=" value="example.com"/> <system_type value="Prototype"/> </and> </hostRequires> 2. Clone the job to look at the XML Actual results: Beaker injects an extra contradictory <system_type/> filter: <hostRequires> <and> <system_type op="=" value="Prototype"/> <hostname op="=" value="example.invalid"/> </and> <system_type value="Machine"/> </hostRequires> causing the recipe to abort with no matching systems. Expected results: Beaker should use the <hostRequires/> exactly as given, it should not inject any extra <system_type/> filter because there is already one present the job. Additional info: The workflow commands will produce a <hostRequires/> like the one above, because they always insert an <and/> at the top level. For example, this will submit a job to reproduce the bug: bkr workflow-simple --family RedHatEnterpriseLinux7 --arch x86_64 --hostrequire 'hostname=example.invalid' --systype Prototype --task /distribution/reservesys
This is a regression in 22.0 due to a rather subtle mistake with the lxml conversion that we did. http://gerrit.beaker-project.org/4647
Workaround is to change the <hostRequires/> so that it has a <system_type/> element as a top-level child. Using the example from comment 0 it could become either: <hostRequires> <system_type value="Prototype"/> <and> <hostname op="=" value="example.com"/> <system_type value="Prototype"/> </and> </hostRequires> or simpler: <hostRequires> <hostname op="=" value="example.com"/> <system_type value="Prototype"/> </hostRequires> or even just: <hostRequires force="example.com"/> Unfortunately if the job is being generated by a bkr workflow command, I cannot suggest any workaround because the workflow commands always unconditionally wrap the hostRequires inside an <and/> element.
Verified steps: 1. Submit a job with <hostRequires/> like this: <hostRequires> <and> <hostname op="=" value="example.com"/> <system_type value="Prototype"/> </and> </hostRequires> 2. Clone the job and the extra <system_type/> filter is not injected in the XML.
Beaker 22.1 has been released.