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
dnf: don't return fail_json['msg'] as list #65302
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.
I was told by @felixfontein on irc that this bugfix needs a changelog entry file. |
needs changelog fragment, but otherwise it's good |
shipit |
@ianw could you merge @ssbarnea's PR on your branch, or add a (similar) changelog fragment yourself? (If you merge the PR: make sure to either choose "Rebase and merge" or "Squash and merge" (via the arrow next to the big green merge button); the default merge will create a merge commit, which will cause ansibot to scream at you :) ) |
Although it's not enforced that fail_json['msg'] should be a string [1], I think it is pretty strongly implied. In this case the failure_response['msg'] is sent through as the fail_json['msg'], and the trailing commas here turn it into a tuple. It's not clear if this is a typo or intended, but it does cause problems for callbacks that expect this as a string (e.g. [2]). Since there seems no point to having these values as a tuple, remove the trailing commas so they return a string as per everywhere else. [1] https://github.com/ansible/ansible/blob/4c589661c2add45023f2bff9203e0c4e11efe5f6/lib/ansible/module_utils/basic.py#L2078 [2] https://review.opendev.org/#/c/696081
f29baff
to
cbe43cb
Compare
@felixfontein @ssbarnea done with the latest changeset, thanks |
rebuild_merge |
Awesome! Who wants to create a backport PR? |
Although it's not enforced that fail_json['msg'] should be a string [1], I think it is pretty strongly implied. In this case the failure_response['msg'] is sent through as the fail_json['msg'], and the trailing commas here turn it into a tuple. It's not clear if this is a typo or intended, but it does cause problems for callbacks that expect this as a string (e.g. [2]). Since there seems no point to having these values as a tuple, remove the trailing commas so they return a string as per everywhere else. [1] https://github.com/ansible/ansible/blob/4c589661c2add45023f2bff9203e0c4e11efe5f6/lib/ansible/module_utils/basic.py#L2078 [2] https://review.opendev.org/#/c/696081 (cherry picked from commit fc54ae9)
Although it's not enforced that fail_json['msg'] should be a string [1], I think it is pretty strongly implied. In this case the failure_response['msg'] is sent through as the fail_json['msg'], and the trailing commas here turn it into a tuple. It's not clear if this is a typo or intended, but it does cause problems for callbacks that expect this as a string (e.g. [2]). Since there seems no point to having these values as a tuple, remove the trailing commas so they return a string as per everywhere else. [1] https://github.com/ansible/ansible/blob/4c589661c2add45023f2bff9203e0c4e11efe5f6/lib/ansible/module_utils/basic.py#L2078 [2] https://review.opendev.org/#/c/696081 (cherry picked from commit fc54ae9)
Although it's not enforced that fail_json['msg'] should be a string [1], I think it is pretty strongly implied. In this case the failure_response['msg'] is sent through as the fail_json['msg'], and the trailing commas here turn it into a tuple. It's not clear if this is a typo or intended, but it does cause problems for callbacks that expect this as a string (e.g. [2]). Since there seems no point to having these values as a tuple, remove the trailing commas so they return a string as per everywhere else. [1] https://github.com/ansible/ansible/blob/4c589661c2add45023f2bff9203e0c4e11efe5f6/lib/ansible/module_utils/basic.py#L2078 [2] https://review.opendev.org/#/c/696081
SUMMARY
Although it's not enforced that fail_json['msg'] should be a string
[1], I think it is pretty strongly implied.
In this case the failure_response['msg'] is sent through as the
fail_json['msg'], and the trailing commas here turn it into a tuple.
It's not clear if this is a typo or intended, but it does cause
problems for callbacks that expect this as a string (e.g. [2]).
Since there seems no point to having these values as a tuple, remove
the trailing commas so they return a string as per everywhere else.
[1]
ansible/lib/ansible/module_utils/basic.py
Line 2078 in 4c58966
[2] https://review.opendev.org/#/c/696081
ISSUE TYPE
COMPONENT NAME
dnf