-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
dig: Fix evaluation of boolean parameters #5129
dig: Fix evaluation of boolean parameters #5129
Conversation
Thank you, @mu1f407 |
shipit |
Done. Thanks for hints @felixfontein. |
The test
|
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
Backport to stable-4: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 3c2d7eb on top of patchback/backports/stable-4/3c2d7eb193ac6676a054396c2d41328f23862104/pr-5129 Backporting merged PR #5129 into main
🤖 @patchback |
Backport to stable-5: 💚 backport PR created✅ Backport PR branch: Backported as #5137 🤖 @patchback |
* Add lookup_dig tests * Fix boolean evaluation * Add changelog fragment * Apply review changes * Add license (cherry picked from commit 3c2d7eb)
SUMMARY
Fixes evaluation of falsy boolean parameters in dig lookup plugin.
ISSUE TYPE
COMPONENT NAME
community.general.dig lookup plugin
ADDITIONAL INFORMATION
Plugin currently uses
bool()
function to convert string boolean values to boolean type. This function in not the right one for this task as is returnsTrue
for every non-empty string:There is function in ansible.module_utils for this which correctly handles string-to-boolean conversion.
I also added tests for dig lookup and this issue specifically.