Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 999056

Summary: Beaker adds empty params element to tasks
Product: [Retired] Beaker Reporter: Nikolai Kondrashov <nikolai.kondrashov>
Component: generalAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.14CC: aigao, asaha, dcallagh, jingwang, kbanerje, llim, qwan, rmancy
Target Milestone: 0.16Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-17 03:01:24 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:
Attachments:
Description Flags
0001-Don-t-add-empty-params-element.patch none

Description Nikolai Kondrashov 2013-08-20 15:57:26 UTC
Description of problem:
Jobs submitted via WebUI having "task" elements without parameters (no or empty
"params" element) are then restored as having an empty "params" element, even
though the schema specifies it as optional.

This makes job XML unnecessarily longer and harder to read when there are many
tasks without parameters.

How reproducible:
Always

Steps to Reproduce:
1. Submit a job containing an empty "task" element, for example:

    <task name="/distribution/install" role="STANDALONE"/>

2. See XML generated when cloning the job.

Actual results:
    <task name="/distribution/install" role="STANDALONE">
        <params/>
    </task>

Expected results:
    <task name="/distribution/install" role="STANDALONE"/>


Additional info:

Consider what a long list of such tasks becomes after submitting the job.
For example, consider what Beaker would output when cloning this task list:

    <task name="/distribution/install" role="STANDALONE"/>
    <task name="/CoreOS/sssd/server_client/ds_setup/nkondras" role="CLIENT"/>
    <task name="/CoreOS/sssd/client/ldap_provider/ignore_group_members/nkondras" role="CLIENT"/>
    <task name="/CoreOS/sssd/client/ldap_provider/ignore_group_members/nkondras" role="CLIENT"/>
    <task name="/CoreOS/sssd/server_client/ds_teardown/nkondras" role="CLIENT"/>
    <task name="/CoreOS/sssd/server_client/ds_setup/nkondras" role="CLIENT"/>
    <task name="/CoreOS/sssd/client/ldap_provider/ignore_group_members/nkondras" role="CLIENT"/>
    <task name="/CoreOS/sssd/client/ldap_provider/ignore_group_members/nkondras" role="CLIENT"/>
    <task name="/CoreOS/sssd/server_client/ds_teardown/nkondras" role="CLIENT"/>

The attached (untested) patch attempts to fix this.

Comment 1 Nikolai Kondrashov 2013-08-20 15:58:14 UTC
Created attachment 788553 [details]
0001-Don-t-add-empty-params-element.patch

Comment 3 Nick Coghlan 2013-08-27 06:39:23 UTC
Thanks for the patch - this probably won't make the next release (0.15), but we'll definitely aim to get it into 0.16 :)

Comment 5 Dan Callaghan 2014-02-05 00:48:26 UTC
On Gerrit: http://gerrit.beaker-project.org/2770

Comment 7 wangjing 2014-02-20 07:31:36 UTC
verified on beaker-devel(build 0.15.4.git.110.c0912fb)-->pass
steps:
1. Submit a job containing empty "task" element, for examples:

   <task name="/distribution/install" role="STANDALONE"/>
   <task name="/xxx/xxx/xxx" role="STANDALONE"/>
       <params>
		</params>
   <task name="/xxx/xxx/xxx/xxx" role="none"/>
       <params/>
   <task name="/distribution/reservesys" role="STANDALONE">
       <params>
	  <param name="RESERVETIME" value="86400"/>
       </params>
   </task>

2. See XML generated when cloning the job.

Actual results:
same as Expected results.

Expected results:
  <task name="/distribution/install" role="STANDALONE"/>
  <task name="/xxx/xxx/xxx" role="STANDALONE"/>
  <task name="/xxx/xxx/xxx/xxx" role="none"/>
  <task name="/distribution/reservesys" role="STANDALONE">
	<params>
		<param name="RESERVETIME" value="86400"/>
	</params>
  </task>

Comment 8 Dan Callaghan 2014-03-17 03:01:24 UTC
Beaker 0.16.0 has been released.