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
[WIP] Make sure that none is not accepted for required module options #72248
base: devel
Are you sure you want to change the base?
Conversation
The 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.
I don't see any tests for the allow_none_value=True
behaviour. Given that this was the original behaviour there should probably be some tests that it's possible to go back to the old behaviour.
Similarly I may have missed it but I don't see any update to the arg_spec sanity tests to ensure its use doesn't trigger a sanity warning.
@treble that's kind of expected, since I only stayed up to long to finish the main part of the PR before I forgot my plans for it ;) |
The test
|
/rebuild_failed |
The test
|
This needs a complete rewrite since the argument spec handling was rewritten / completely refactored. |
SUMMARY
If a value that is required (by required, required_if, required_together, required_one_of, required_by) is specified as
none
/null
/~
/empty, it is only accepted when the option explicitly declaresallow_none_value=True
.Fixes #69190 more closely to https://meetbot.fedoraproject.org/ansible-meeting/2020-05-05/ansible_core_public_irc_meeting.2020-05-05-19.05.log.html than #72243.
ISSUE TYPE
COMPONENT NAME
lib/ansible/module_utils/basic.py
lib/ansible/module_utils/common/validation.py