-
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
[bugfix][1678]Add validation for maker begin end #1684
[bugfix][1678]Add validation for maker begin end #1684
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.
Thank you for the quick addition for the validation, just a few corrections and don't think the test case is necessary as it is, rather, I would like to see a negative test case that checks the validation when both markers are the same, no need to setup a uss env, just call the module and validate the error.
changelogs/fragments/1684-Add_validation_for_marker_begin_end.yml
Outdated
Show resolved
Hide resolved
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 don't think there is need for this new test case, looks like is doing the same as test_uss_block_absent_custommarker
Co-authored-by: Fernando Flores <[email protected]>
Co-authored-by: Fernando Flores <[email protected]>
Co-authored-by: Fernando Flores <[email protected]>
Co-authored-by: Fernando Flores <[email protected]>
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.
Sorry, asking for a redundant change.
Co-authored-by: Fernando Flores <[email protected]>
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.
Thanks for the changes.
bugfixes: | ||
- zos_blockinfile - User could set same values for marker begin and end generate issue on ZOAU python API. | ||
Change now validates that ``marker_begin`` and ``marker_end`` are different and fails if they are the same. | ||
(https://github.com/ansible-collections/ibm_zos_core/pull/1684). |
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.
An Ansible user won't care particularly about bugs in ZOAU (or any other dependencies). Better to use this space to describe the bug as experienced by the Ansible user.
User could previously set the same values for module options 'marker_begin' and 'marker_end', which would result in <..whatever the issue was..>. Fix now introduces a requirement for 'marker_begin' and 'marker_end' to have different values.
Even better would be if you could bring the <..whatever the issue was..> to the beginning,
Previously <..issue..> happened when 'marker_begin' and 'marker_end' were set to the same value. Fix introduces a requirement for 'marker_begin' and 'marker_end' to have different values.
plugins/modules/zos_blockinfile.py
Outdated
required: false | ||
type: str | ||
default: BEGIN | ||
marker_end: | ||
required: false | ||
description: | ||
- This will be inserted at C({mark}) in the closing ansible block marker. | ||
- Required unique value different from marker_begin. |
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.
seems kind of strange to have a different description here than in marker_begin. I'd say pick one or the other and use the same line in both module options
If you go with "Value needs to be different from marker_end." I'd say use stronger language "Value must be different from marker_end."
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.
Agree with @ketankelkar comments and request a change at least in the docs.
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 a correction for a wrong dot, now committed it from GitHub to not have you get back to this.
SUMMARY
Add documentation, test case and validation for user
Fixes #1678
ISSUE TYPE
COMPONENT NAME
Add validation