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
Fix a possible issue with comparing values with $null #37763
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.
Looks good to me
@dagwieers I can't remember, was this to fix an actual issue or just to work with the pslint rules we had at the time? |
@jborean93 This was originally to fix the PSLint rule which we then disabled. But IIRC this was a genuine issue in this specific case as indicated by the comment above the $null comparison. So we make it very simple, if it is actually $null, we return $null with no special treatment from the very start, easier to read that code IMO. |
CI failure in integration tests: https://app.shippable.com/github/ansible/ansible/runs/71742/18/tests |
This PR includes: - Fix $null comparison. - Simplify Get-AnsibleParam in the same effort
6e484ad
to
d072e1b
Compare
@jborean93 The |
@dagwieers is this actually fixing an issue, I'm reluctant to change |
Readability, there's no need anymore to check for an array, or that complexity. Check the diff without whitespace-changes and you'll see this is trivial. |
Fair enough, didn't have the whitespace-changes check and it seems trivial now. |
This PR includes: - Fix $null comparison. - Simplify Get-AnsibleParam in the same effort
This PR includes: - Fix $null comparison. - Simplify Get-AnsibleParam in the same effort
SUMMARY
This PR includes:
ISSUE TYPE
COMPONENT NAME
Ansible.ModuleUtils.Legacy.psm1
ANSIBLE VERSION
v2.6