IBM / ansible-for-i

the tool is to provide several customized modules for Ansible to manage IBM i systems.
GNU General Public License v3.0
55 stars 51 forks source link

ibmi_cl_command stdout_lines issue #106

Open lmaleasi opened 3 years ago

lmaleasi commented 3 years ago

Hello, The ibmi_cl_command doesn't seems to work as expected for its return; in version 1.2.0 of the collection the following command return as good stdout_lines: - ibmi_cl_command: cmd: dspsysval qmaxjob register: result "result": { "changed": false, "cmd": "DSPSYSVAL QMAXJOB", "delta": "0:00:00.230820", "end": "2021-07-08 11:14:22.986098", "failed": false, "job_log": [], "job_name": "", "joblog": false, "rc": 0, "start": "2021-07-08 11:14:22.755278", "stderr": "", "stderr_lines": [], "stdout": " System Values Page 1\n5770SS1 V7R3M0 160422 QEDD1 08/07/21 11:14:22 CEST\n Current Shipped\n Name value value Description\n QMAXJOB 163520 163520 Maximum number of jobs\n Note: > means current value is different from the shipped value\n * * * * * E N D O F L I S T I N G * * * * *\n", "stdout_lines": [ " System Values Page 1", "5770SS1 V7R3M0 160422 QEDD1 08/07/21 11:14:22 CEST", " Current Shipped", " Name value value Description", " QMAXJOB 163520 163520 Maximum number of jobs", " Note: > means current value is different from the shipped value", " * * * * * E N D O F L I S T I N G * * * * *" ] }

But for all the higher versions, here is the output: "result": { "changed": false, "cmd": "dspsysval qmaxjob", "delta": "0:00:00.338841", "end": "2021-07-08 11:14:41.491128", "failed": false, "job_log": [], "job_name": "504449/QUSER/QSQSRVR", "joblog": false, "rc": 0, "start": "2021-07-08 11:14:41.152287", "stderr": "", "stderr_lines": [], "stdout": "{'success': '+++ success dspsysval qmaxjob'}", "stdout_lines": [ "{'success': '+++ success dspsysval qmaxjob'}" ] }

changlexc commented 3 years ago

Thanks for catching. This issue is a regression when I removed the converting upper case for the command string when passing to itoolkit underneath due to a complain for 'password should not convert to upper case'. I will fix it next release. As a workaround, could you please use upper case for the command 'DSPSYSVAL QMAXJOB' instead?

lmaleasi commented 3 years ago

Hi @changlexc, I confirm that the workaround is working well in the last version of the collection (1.4.0) Thank you for your fast reaction ;-)