Bug 999056 - Beaker adds empty params element to tasks
Beaker adds empty params element to tasks
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: general (Show other bugs)
0.14
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 0.16
: ---
Assigned To: Dan Callaghan
tools-bugs
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-20 11:57 EDT by Nikolai Kondrashov
Modified: 2018-02-05 19:41 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-03-16 23:01:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
0001-Don-t-add-empty-params-element.patch (1018 bytes, patch)
2013-08-20 11:58 EDT, Nikolai Kondrashov
no flags Details | Diff

  None (edit)
Description Nikolai Kondrashov 2013-08-20 11:57:26 EDT
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 11:58:14 EDT
Created attachment 788553 [details]
0001-Don-t-add-empty-params-element.patch
Comment 3 Nick Coghlan 2013-08-27 02:39:23 EDT
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-04 19:48:26 EST
On Gerrit: http://gerrit.beaker-project.org/2770
Comment 7 wangjing 2014-02-20 02:31:36 EST
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-16 23:01:24 EDT
Beaker 0.16.0 has been released.

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