Closed SkrrtBacharach closed 6 days ago
In this case you can ignore my comment, the Labels
has default value None
, and not {}
(which I'd expect), that's why it returns None
:
>>> print({"a": None}.get("a"))
None
So using .get() or {}
here is the right choice.
Thanks for bringing it up!
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
I recently authored PR #811. I was trying to address all feedback items on the PR, but I had trouble with one specific feedback item: https://github.com/containers/ansible-podman-collections/pull/811#discussion_r1771980835ed . I couldn't figure out why this line causes a test failure, as it seems like it should work. Unfortunately, the PR was merged before this could be resolved, so I'm logging an issue for visibility.
Steps to reproduce the issue:
See https://github.com/containers/ansible-podman-collections/pull/811#discussion_r1771980835 Describe the results you received:
See https://github.com/containers/ansible-podman-collections/pull/811#discussion_r1771980835
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Version of the
containers.podman
collection: Either git commit if installed from git:git show --summary
Or version fromansible-galaxy
if installed from galaxy:ansible-galaxy collection list | grep containers.podman
Output of
ansible --version
:Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Playbok you run with ansible (e.g. content of
playbook.yaml
):See https://github.com/containers/ansible-podman-collections/pull/811#discussion_r1771980835
Command line and output of ansible run with high verbosity
Please NOTE: if you submit a bug about idempotency, run the playbook with
--diff
option, like:See https://github.com/containers/ansible-podman-collections/pull/811#discussion_r1771980835ed