-
Notifications
You must be signed in to change notification settings - Fork 46
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
[v1.9.0] [Backport] [zos_job_submit] Handling of non-UTF-8 chars #1288
Conversation
…(originally from #1261) * Added test to validate handling of non-UTF8 chars * Add changelog fragment * Clean up new test * Add try-except block when reading a job's output * Remove commented code * Update changelog fragment * Change job queried in test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can convince me if I misunderstood that test, but it looks wrong to me at the moment.
|
||
# Create local JCL and submit it. | ||
tmp_file = tempfile.NamedTemporaryFile(delete=True) | ||
with open(tmp_file.name, "w") as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not as a change just as a question which form is better doing a open as f
or a echo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For local files, open as f
. For remote files, echo
so we can avoid a call to our own collection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than which function is better to write a file I like the changes on the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @rexemin - I did ask for a small update to include some additional hex values.
Question, how do you want to test this, I am still waiting on 1.2.5.6 for the non-printable chars so we can't pass until that is present. I could test locally once I get it but do we want to hold this PR till then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @rexemin thanks for the changes.
@rexemin I took the latest build from ZOAU and mounted on my private DASD, I ran both a positive and negative scenario via a playbook. I checked out the source and built it then drove C program below for full coverage of a EBCDIC chars:
Both results were as expected , when I used a version older than 1.2.5.6, the exception caught prevent the module from failing and when all ebcdic chars entered the stdout stream, it functioned well. |
Conflicts: tests/functional/modules/test_zos_job_submit_func.py Changes to be committed: modified: .ansible-lint modified: README.md new file: changelogs/fragments/1246-bugfix-zos_job_submit-typrun.yml new file: changelogs/fragments/1292-doc-zos_tso_command-example.yml new file: changelogs/fragments/1294-doc-zos_ping-scp.yml new file: changelogs/fragments/1296-doc-sftp-collection-requirements.yml modified: changelogs/fragments/v1.9.0_summary.yml modified: docs/source/modules/zos_archive.rst modified: docs/source/modules/zos_copy.rst modified: docs/source/modules/zos_fetch.rst modified: docs/source/modules/zos_job_submit.rst modified: docs/source/modules/zos_ping.rst modified: docs/source/modules/zos_script.rst modified: docs/source/modules/zos_tso_command.rst modified: docs/source/modules/zos_unarchive.rst modified: docs/source/plugins.rst modified: galaxy.yml modified: meta/ibm_zos_core_meta.yml modified: meta/runtime.yml modified: plugins/module_utils/job.py modified: plugins/modules/zos_copy.py modified: plugins/modules/zos_fetch.py modified: plugins/modules/zos_job_submit.py modified: plugins/modules/zos_ping.py modified: plugins/modules/zos_ping.rexx modified: plugins/modules/zos_script.py modified: plugins/modules/zos_tso_command.py modified: plugins/modules/zos_unarchive.py modified: tests/functional/modules/test_zos_job_submit_func.py
Output from my testing:
Testing the negative path where non-printable chars are not supported.
|
SUMMARY
Fixes #1255.
Backports to v1.9.0 the fix from #1261.
ISSUE TYPE
COMPONENT NAME