community.general/lib/ansible/plugins
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
..
action Improve --diff output when files lack trailing newlines 2017-01-09 11:49:03 -05:00
cache bad/missing fact plugin is a warning (#19350) 2016-12-14 14:25:19 -05:00
callback Improve --diff output when files lack trailing newlines 2017-01-09 11:49:03 -05:00
connection adds new feature to network_cli (#19848) 2017-01-03 22:33:02 -05:00
filter shuffle filter: added optional 'seed' parameter 2017-01-03 11:08:36 -05:00
lookup new lookup module: mongodb (#15057) 2017-01-03 11:40:02 -05:00
shell Mcsalgado's change to use shlex.quote instead of pipes.quote (#18534) 2016-11-17 13:18:29 -08:00
strategy allow modules to set custom stats (#18946) 2017-01-05 16:38:36 -05:00
terminal removes network os guess static method (#19467) 2016-12-19 07:47:29 -05:00
test restored 'results' filters 2016-10-13 13:21:40 -04:00
vars Making the switch to v2 2015-05-03 21:47:26 -05:00
__init__.py adds two new plugins that use ansible-connection for persistence (#18572) 2016-11-28 12:49:40 -05:00