Skip to content
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

add option to force dig lookup to return empty list #5439

Merged
merged 1 commit into from
Oct 29, 2022
Merged

add option to force dig lookup to return empty list #5439

merged 1 commit into from
Oct 29, 2022

Conversation

jpmens
Copy link
Contributor

@jpmens jpmens commented Oct 29, 2022

SUMMARY

This fix causes dig lookup to return an empty list instead of a list of empty strings, behaviour which was probably erroneously introduced years ago but which seems a bug.

Fixes #5428

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

dig

ADDITIONAL INFORMATION
TASK [Print retrieve NS] ************************************************************
ok: [localhost] => {
    "ns": []
}

TASK [nxdomain (real_empty==False)] *************************************************
ok: [localhost] => {
    "msg": [
        "NXDOMAIN"
    ]
}

TASK [nxdomain (real_empty==True)] **************************************************
ok: [localhost] => {
    "msg": []
}

Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you add a changelog fragment as well?

plugins/lookup/dig.py Outdated Show resolved Hide resolved
@ansibullbot ansibullbot added bug This issue/PR relates to a bug lookup lookup plugin plugins plugin (any type) labels Oct 29, 2022
@jpmens
Copy link
Contributor Author

jpmens commented Oct 29, 2022

Can you add a changelog fragment as well?

done.

@github-actions
Copy link

github-actions bot commented Oct 29, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@felixfontein felixfontein added the check-before-release PR will be looked at again shortly before release and merged if possible. label Oct 29, 2022
@felixfontein felixfontein merged commit df34a7b into ansible-collections:main Oct 29, 2022
@felixfontein
Copy link
Collaborator

@jpmens thanks for improving the plugin!

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Nov 1, 2022
rekup pushed a commit to rekup/community.general that referenced this pull request Nov 3, 2022
russoz pushed a commit to russoz-ansible/community.general that referenced this pull request Nov 5, 2022
bratwurzt pushed a commit to bratwurzt/community.general that referenced this pull request Nov 7, 2022
bratwurzt pushed a commit to bratwurzt/community.general that referenced this pull request Nov 7, 2022
This was referenced Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug lookup lookup plugin plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dig + wantlist can return a list with an empty string instead of an empty list
3 participants