New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job import: some xml attributes are ignored #2979

Closed
scollector65 opened this Issue Dec 5, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@scollector65
Contributor

scollector65 commented Dec 5, 2017

Issue type: Bug report

My Rundeck detail

  • Rundeck version: 2.10.0
  • install type: (rpm,deb,war,launcher?) launcher
  • OS Name/version: linux
  • DB Type/version: mysql? postgres? h2?.. h2

Expected Behavior
import xml & saved result is same

Actual Behavior
I set "job.context.options.option" with "preserveOrder", "multivalued", "isDate" false
but save data is true

How to Reproduce
post /api/21/project/{project name}/jobs/import
with false value

Please test again "Job import API", there are many bug.

@scollector65

This comment has been minimized.

Show comment
Hide comment
@scollector65

scollector65 Dec 5, 2017

Contributor

I think this is same bug with #2931, #2961
When I don't set value(not T/F, don't give xml element), this values become T or F (maybe default value).
So I think this API have bug like "the code below" for some fields
("successOnEmptyNodeFilter", "multipleExecutions", "preserveOrder", "multivalued", "isDate", more.....).

if (xml element exist) {
set True;
} else {
set Default Value;
}

Contributor

scollector65 commented Dec 5, 2017

I think this is same bug with #2931, #2961
When I don't set value(not T/F, don't give xml element), this values become T or F (maybe default value).
So I think this API have bug like "the code below" for some fields
("successOnEmptyNodeFilter", "multipleExecutions", "preserveOrder", "multivalued", "isDate", more.....).

if (xml element exist) {
set True;
} else {
set Default Value;
}

@gschueler gschueler added the bug label Dec 13, 2017

@gschueler gschueler added this to the 2.10.2 milestone Dec 13, 2017

@gschueler

This comment has been minimized.

Show comment
Hide comment
@gschueler

gschueler Dec 16, 2017

Member

please post an example of the job xml you are importing

Member

gschueler commented Dec 16, 2017

please post an example of the job xml you are importing

@scollector65

This comment has been minimized.

Show comment
Hide comment
@scollector65

scollector65 Dec 18, 2017

Contributor

This is xml that import and get def
In this case, multipleExecutions is not working

POST, http://127.0.0.1:4440/api/21/project/aa/jobs/import?dupeOption&uuidOption

<joblist>
   <job>
      <context>
         <options>
            <option name="argument" />
         </options>
      </context>
      <description />
      <dispatch>
         <threadcount>1</threadcount>
         <keepgoing>true</keepgoing>
         <rankOrder>ascending</rankOrder>
         <excludePrecedence>true</excludePrecedence>
      </dispatch>
      <executionEnabled>false</executionEnabled>
      <loglevel>INFO</loglevel>
      <multipleExecutions>false</multipleExecutions>
      <name>new job1</name>
      <nodeFilterEditable>false</nodeFilterEditable>
      <nodesSelectedByDefault>true</nodesSelectedByDefault>
      <orchestrator>
         <configuration>
            <count>3</count>
         </configuration>
         <type>subset</type>
      </orchestrator>
      <nodefilters>
         <filter>tags:default</filter>
      </nodefilters>
      <schedule />
      <scheduleEnabled>false</scheduleEnabled>
      <sequence keepgoing="false" strategy="node-first">
         <command>
            <exec>/data01/batch/ignite/cmd/runner.sh ${job.execid} ${job.id} ${option.argument}aa</exec>
         </command>
      </sequence>
      <uuid>dfb29f4627b8465492332886fcd88b0f</uuid>
   </job>
</joblist>

GET, http://127.0.0.1:4440/api/21/job/dfb29f4627b8465492332886fcd88b0f

<joblist>
   <job>
      <context>
         <options preserveOrder="true">
            <option name="argument" />
         </options>
      </context>
      <description />
      <dispatch>
         <excludePrecedence>true</excludePrecedence>
         <keepgoing>true</keepgoing>
         <rankOrder>ascending</rankOrder>
         <successOnEmptyNodeFilter>false</successOnEmptyNodeFilter>
         <threadcount>1</threadcount>
      </dispatch>
      <executionEnabled>false</executionEnabled>
      <id>dfb29f4627b8465492332886fcd88b0f</id>
      <loglevel>INFO</loglevel>
      <multipleExecutions>true</multipleExecutions>
      <name>new job1</name>
      <nodeFilterEditable>false</nodeFilterEditable>
      <nodefilters>
         <filter>tags:default</filter>
      </nodefilters>
      <nodesSelectedByDefault>true</nodesSelectedByDefault>
      <orchestrator>
         <configuration>
            <count>3</count>
         </configuration>
         <type>subset</type>
      </orchestrator>
      <scheduleEnabled>false</scheduleEnabled>
      <sequence keepgoing="false" strategy="node-first">
         <command>
            <exec>/data01/batch/ignite/cmd/runner.sh ${job.execid} ${job.id} ${option.argument}aa</exec>
         </command>
      </sequence>
      <uuid>dfb29f4627b8465492332886fcd88b0f</uuid>
   </job>
</joblist>
Contributor

scollector65 commented Dec 18, 2017

This is xml that import and get def
In this case, multipleExecutions is not working

POST, http://127.0.0.1:4440/api/21/project/aa/jobs/import?dupeOption&uuidOption

<joblist>
   <job>
      <context>
         <options>
            <option name="argument" />
         </options>
      </context>
      <description />
      <dispatch>
         <threadcount>1</threadcount>
         <keepgoing>true</keepgoing>
         <rankOrder>ascending</rankOrder>
         <excludePrecedence>true</excludePrecedence>
      </dispatch>
      <executionEnabled>false</executionEnabled>
      <loglevel>INFO</loglevel>
      <multipleExecutions>false</multipleExecutions>
      <name>new job1</name>
      <nodeFilterEditable>false</nodeFilterEditable>
      <nodesSelectedByDefault>true</nodesSelectedByDefault>
      <orchestrator>
         <configuration>
            <count>3</count>
         </configuration>
         <type>subset</type>
      </orchestrator>
      <nodefilters>
         <filter>tags:default</filter>
      </nodefilters>
      <schedule />
      <scheduleEnabled>false</scheduleEnabled>
      <sequence keepgoing="false" strategy="node-first">
         <command>
            <exec>/data01/batch/ignite/cmd/runner.sh ${job.execid} ${job.id} ${option.argument}aa</exec>
         </command>
      </sequence>
      <uuid>dfb29f4627b8465492332886fcd88b0f</uuid>
   </job>
</joblist>

GET, http://127.0.0.1:4440/api/21/job/dfb29f4627b8465492332886fcd88b0f

<joblist>
   <job>
      <context>
         <options preserveOrder="true">
            <option name="argument" />
         </options>
      </context>
      <description />
      <dispatch>
         <excludePrecedence>true</excludePrecedence>
         <keepgoing>true</keepgoing>
         <rankOrder>ascending</rankOrder>
         <successOnEmptyNodeFilter>false</successOnEmptyNodeFilter>
         <threadcount>1</threadcount>
      </dispatch>
      <executionEnabled>false</executionEnabled>
      <id>dfb29f4627b8465492332886fcd88b0f</id>
      <loglevel>INFO</loglevel>
      <multipleExecutions>true</multipleExecutions>
      <name>new job1</name>
      <nodeFilterEditable>false</nodeFilterEditable>
      <nodefilters>
         <filter>tags:default</filter>
      </nodefilters>
      <nodesSelectedByDefault>true</nodesSelectedByDefault>
      <orchestrator>
         <configuration>
            <count>3</count>
         </configuration>
         <type>subset</type>
      </orchestrator>
      <scheduleEnabled>false</scheduleEnabled>
      <sequence keepgoing="false" strategy="node-first">
         <command>
            <exec>/data01/batch/ignite/cmd/runner.sh ${job.execid} ${job.id} ${option.argument}aa</exec>
         </command>
      </sequence>
      <uuid>dfb29f4627b8465492332886fcd88b0f</uuid>
   </job>
</joblist>

@gschueler gschueler closed this in ae2b6ea Dec 19, 2017

gschueler added a commit that referenced this issue Dec 19, 2017

Merge pull request #3011 from rundeck/issue/2979
Fixes #2979 #2931 #2961 improve job xml parsing

@gschueler gschueler changed the title from Job import API to Job import: some xml attributes are ignored Dec 19, 2017

ahormazabal added a commit to variacode/rundeck that referenced this issue Jan 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment