Bug 999056 - Beaker adds empty params element to tasks
Summary: Beaker adds empty params element to tasks
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: general
Version: 0.14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 0.16
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-20 15:57 UTC by Nikolai Kondrashov
Modified: 2018-02-06 00:41 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-03-17 03:01:24 UTC
Embargoed:


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

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.


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