-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Ansible tries to parse contents of diffs #45717
Labels
affects_2.6
This issue/PR affects Ansible v2.6
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
Comments
For anyone reading this from Google searches. You can work around this problem on a per-task basis by setting: - name: mytask
copy:
src: whatevs
dest: whatevs
diff: no |
We've tracked this down to a python3 compatibility issue, and are discussing the correct fix. |
sivel
added a commit
to sivel/ansible
that referenced
this issue
Sep 17, 2018
sivel
added a commit
that referenced
this issue
Sep 20, 2018
#45744) * Ensure that the src file contents is converted to unicode in diff info. Fixes #45717 * Fix up and cleanup * The diff functionality in the callback plugins should have the to_text() calls removed since we're now doing it in ActionBase * catching of UnicodeError and warnings in the callback diff functionality from 61d01f5 haven't been needed since we switched to to_text so remove them. * Add a note to ActionBase's diff function giving an example of when the diff function will be inaccurate and how to fix it * Fix callback get_diff() tests I believe the unittests of callback's get_diff() were wrong. They were sending in a list where strings were expected. Because previous code was transforming the lists into strings via their repr, the previous tests did not fail but they would have formatted the test cases output in an odd way if we had looked at it.
sivel
added a commit
to sivel/ansible
that referenced
this issue
Jan 8, 2019
…e in diff info (ansible#45744) * Ensure that the src file contents is converted to unicode in diff info. Fixes ansible#45717 * Fix up and cleanup * The diff functionality in the callback plugins should have the to_text() calls removed since we're now doing it in ActionBase * catching of UnicodeError and warnings in the callback diff functionality from 61d01f5 haven't been needed since we switched to to_text so remove them. * Add a note to ActionBase's diff function giving an example of when the diff function will be inaccurate and how to fix it * Fix callback get_diff() tests I believe the unittests of callback's get_diff() were wrong. They were sending in a list where strings were expected. Because previous code was transforming the lists into strings via their repr, the previous tests did not fail but they would have formatted the test cases output in an odd way if we had looked at it. (cherry picked from commit 95e77ac) Co-authored-by: Matt Martz <matt@sivel.net>
abadger
pushed a commit
that referenced
this issue
Jan 9, 2019
…e in diff info (#45744) * Ensure that the src file contents is converted to unicode in diff info. Fixes #45717 * Fix up and cleanup * The diff functionality in the callback plugins should have the to_text() calls removed since we're now doing it in ActionBase * catching of UnicodeError and warnings in the callback diff functionality from 61d01f5 haven't been needed since we switched to to_text so remove them. * Add a note to ActionBase's diff function giving an example of when the diff function will be inaccurate and how to fix it * Fix callback get_diff() tests I believe the unittests of callback's get_diff() were wrong. They were sending in a list where strings were expected. Because previous code was transforming the lists into strings via their repr, the previous tests did not fail but they would have formatted the test cases output in an odd way if we had looked at it. (cherry picked from commit 95e77ac) Co-authored-by: Matt Martz <matt@sivel.net>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
affects_2.6
This issue/PR affects Ansible v2.6
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
I've tried to search for this problem in the issue tracker with the keywords
--diff
,crash
, andparse
, but haven't found anything.SUMMARY
Diff printing seems to attempt to resolve variables in diffed files/parse them.
ISSUE TYPE
COMPONENT NAME
Diff mode and
copy
module.ANSIBLE VERSION
and
CONFIGURATION
No output. Running with default config.
OS / ENVIRONMENT
Originally seen in a more complex setting, but reproducible when running on Ubuntu 18.04, deploying with
ansible_connection=local
.STEPS TO REPRODUCE
I've created a git repository which has a minimal test case: https://github.com/duijf/ansible-bug-report
Please tell me if anything is unclear.
EXPECTED RESULTS
Ansible does not crash and reports changed results correctly.
ACTUAL RESULTS
Ansible crashes.
This only happens when:
--diff
is used.It seems like Ansible is trying to interpret the output of the diff, since it prints
unexpected char '$' at 101
.The text was updated successfully, but these errors were encountered: