-
Notifications
You must be signed in to change notification settings - Fork 44
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.10.0] [module_utils/encode.py] Implement ZOAU 1.3 migration changes into module_utils/encode.py #1189
Merged
fernandofloresg
merged 6 commits into
dev
from
enabler/1120/migrate-module_utils-encode
Jan 31, 2024
Merged
[v1.10.0] [module_utils/encode.py] Implement ZOAU 1.3 migration changes into module_utils/encode.py #1189
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0bf0f38
Updated module_utils encode
fernandofloresg 2fdd29e
Updated changelog
fernandofloresg c10e0fc
Update 1189-migrate-module_utils-encode.yml
fernandofloresg 4655130
Modified datasets.create call
fernandofloresg 04a38d8
Changed datasets.create call
fernandofloresg a4f5e5e
Merge branch 'dev' into enabler/1120/migrate-module_utils-encode
fernandofloresg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
trivial: | ||
- module_utils/encode.py - migrate code to use ZOAU v1.3.0. | ||
(https://github.com/ansible-collections/ibm_zos_core/pull/1189). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Curious why you removed this validation
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.
This is because I removed the internal function
that returned a ZOAUResponse object to
which according to ZOAU documentation will return a DataSet object , I just changed this in the code to get the data set object and actually return the data set name in the data set object created by ZOAU. My logic on removing the OSError, is to instead of having to catch ZOAUException or DatasetVerificationError and mask it into a OSError with a vague error message like "Failed when allocating temporary sequential data set!", rather raise the specific ZOAU error with better details on failure.
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.
Good question and good answer, I like this approach :), this will work, interesting enough is ZOAUException is raised by ZOAU when RC >=8 :).
The error was vague so this approach is better; our modules are regularly creating stateful objects (temporary files and data sets) unbeknown to the user so even floating an error up from ZOAU might be a bit confusing not much we can do but possibly make a general statement in every module notes section that we might create temporary objects (not this PR).
One suggestion though, if we don't throw the OSError anymore, could we remove it?
What are your thoughts about adding
ZOAUException
orDatasetVerificationError
to ourRaises
instead so our team has easy access or is this to dynamic? The style guide says:One other thing, and I can do this is to post in our internal channel for those using our module_utils of this minor change, just to let them know.
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.
hey thanks for informing other teams using the module_utils, I did add the exceptions into the docstring