Bug 737823

Summary: [PATCH] workflow-xslt: Implement support for boolean arguments
Product: [Retired] Beaker Reporter: David Sommerseth <davids>
Component: command lineAssignee: Bill Peck <bpeck>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.7CC: bpeck, dcallagh, mcsontos, ovasik, rmancy, stl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-20 06:19:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Sommerseth 2011-09-13 08:01:16 UTC
New feature for workflow-xslt:

workflow-xslt: Implement support for boolean arguments

This patch implements support for defining boolean argument types
in the job XML configuration. When this is used, workflow-xslt will
setup an argument which takes no options. When this option is present
the resulting XML file will use the value 'true' in the corresponding
XML tag/attribute.

Signed-off-by: David Sommerseth <davids>


http://beaker-gerrit.app.eng.bne.redhat.com/#change,669

Comment 2 Raymond Mancy 2011-09-20 03:47:44 UTC
I tried to run and verify this change on my local box, and I think it works as expected,

I used the example-job.xml from the man page and added: 

  <arg section="recipe" type="bool">
    <name>foo</name>
    <metavar>ENABLE-FOO</metavar>
    <default>false</default>
    <tag type="attribute" attrname="foo">name</tag>
    <description>foo identifier</description
  </arg>

And then ran the following:

  bkr workflow-xslt --dry-run --job-xml example_job.xml --save-internal-xml  example.xml -i 99 -n "Example" -g "Group1" --phone-numbers 123,456,789 --foo

The results it spat out was:

  <submit>
    <whiteboard/>
    <recipe>
      <phones>
        <number>123</number>
        <number>456</number>
        <number>789</number>
      </phones>
      <name foo="true" group="Group1" version="99">Example</name>
    </recipe>
  </submit>

This seems fine to me.

Comment 3 David Sommerseth 2011-09-20 09:23:30 UTC
ACK.  This is exactly how this feature is designed to work.