-
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
[Enabler][Zos Job Submit]Update undocumented argument and import exception #1091
[Enabler][Zos Job Submit]Update undocumented argument and import exception #1091
Conversation
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.
Requested changes to avoid tech debt in the future and also add a changelog please.
plugins/modules/zos_job_submit.py
Outdated
@@ -902,7 +899,7 @@ def run_module(): | |||
from_encoding = parsed_args.get("from_encoding") | |||
to_encoding = parsed_args.get("to_encoding") | |||
# temporary file names for copied files when user sets location to LOCAL | |||
temp_file = parsed_args.get("temp_file") | |||
temp_file = parsed_args.get("src") |
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.
I would suggest doing this change instead :
temp_file = parsed_args.get("src") | |
if location == "LOCAL": | |
temp_file = parsed_args.get("src") |
That way temp_file
is indeed a temporary file on the remote and we don't need to worry on the location
conditions in the future, if temp_file
is None we know we don't have to remove anything.
plugins/modules/zos_job_submit.py
Outdated
@@ -1039,7 +1036,7 @@ def run_module(): | |||
module.exit_json(**result) | |||
|
|||
finally: | |||
if temp_file: | |||
if location != "DATA_SET" and location != "USS": |
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.
if location != "DATA_SET" and location != "USS": | |
if temp_file: |
I suggest keeping it this way bc that will help us avoid having to check for state and just remove it if it exists.
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.
It generates a error if the local file is named as a dataset (USER.LOCAL) then the file /user.local will fail that verification
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.
I'm sorry I don't get how that relates to this code suggestion, could you explain?
I made some extra changes and I'm waiting for the pipeline to finish. |
In case anyone wonders why |
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 to me now
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!
SUMMARY
Update temp_path and how to import exceptions.
Fiexes #997 #998 #999
ISSUE TYPE
ADDITIONAL INFORMATION
Remove tmp path from options and only work with source as name of tmp file, because it was undocumented argument for ansible and could be any name, also only in case is local make the tmp file, so didn't expect a dataset or file with the same name on the system. Also make a implementation of imports of exceptions by using new implementation to avoid losing context when an import fails.
Pipeline Without Zos_copy


Pipeline with zos_copy