community.general/lib/ansible/plugins/callback
Marius Gedminas 0a7f2c202b Improve --diff output when files lack trailing newlines
The behavior now matches GNU diff.

Fixes #14094.

Example of output before this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null+curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

after this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null
    \ No newline at end of file
    +curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

The added unit tests contain more examples.

This commit also takes care to avoid "no newline at EOF" warnings when
no_log is in effect, and also when modules return dicts rather than
strings.  (It also removes trailing whitespace from using json
serialization when diffing dicts, because I hate trailing whitespace in
Python source files, even if they're test files.)
2017-01-09 11:49:03 -05:00
..
__init__.py Improve --diff output when files lack trailing newlines 2017-01-09 11:49:03 -05:00
actionable.py actionable.py: Do not print next task banner in handler callback (#15698) 2016-05-03 11:25:46 -04:00
context_demo.py Fix context_demo callback plugin. (#17235) 2016-08-25 10:22:27 -07:00
debug.py Add missing boilerplate code. (#16980) 2016-08-05 12:22:52 -07:00
default.py allow modules to set custom stats (#18946) 2017-01-05 16:38:36 -05:00
dense.py disable 'dense' callback in py26 2016-11-18 11:41:56 -05:00
foreman.py minor spelling changes 2016-12-13 13:51:13 -05:00
hipchat.py Fix hipchat callback "has no attribute display'" (#16998) 2016-08-08 11:04:06 -04:00
jabber.py Remove direct calls to print and cleanup imports 2016-11-07 17:12:36 -05:00
json.py Remove direct calls to print and cleanup imports 2016-11-07 17:12:36 -05:00
junit.py Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423) 2016-09-06 22:54:17 -07:00
log_plays.py Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423) 2016-09-06 22:54:17 -07:00
logentries.py Get rid of logentries.to_unicode. 2016-04-30 07:45:51 -07:00
logstash.py ansible-logstash-callback (#18282) 2016-11-08 11:17:05 -05:00
mail.py Performance improvement using in-operator on dicts 2016-11-17 12:33:04 -05:00
minimal.py Ensure that command/shell errors are displayed 2016-12-16 21:46:02 -05:00
oneline.py Ensure that command/shell errors are displayed 2016-12-16 21:46:02 -05:00
osx_say.py
profile_tasks.py Removed dict.iteritems() in several other files. 2016-12-14 08:01:45 -08:00
profile_tasks.rst updated docs to show new output 2016-03-03 18:05:39 -05:00
skippy.py Renaming per-item and retry callbacks 2016-03-18 15:17:43 -04:00
slack.py avoid exceptiosn when not being called by CLI 2016-03-17 07:19:35 -07:00
syslog_json.py runner_on_async_failed missing arg 2016-12-22 16:55:46 -08:00
timer.py
tree.py Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423) 2016-09-06 22:54:17 -07:00