summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorEvan Kaufman <evan@digitalflophouse.com>2016-08-04 14:00:04 -0700
committerMichael Scherer <mscherer@users.noreply.github.com>2016-10-23 22:43:11 +0200
commit7c9401a7ff4e3c1d1078be06293afca089d7fc05 (patch)
tree345ccc0394cca1aca5b96ab4cc2117b0d5444546 /system
parent10b0580ff48b7d7937836425a3f2c37322ad34a8 (diff)
downloadansible-modules-core-7c9401a7ff4e3c1d1078be06293afca089d7fc05.tar.gz
Rendering of crontab should reflect actual newline termination, in diff mode
Diffstat (limited to 'system')
-rw-r--r--system/cron.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/cron.py b/system/cron.py
index f13032c8..634d1d6b 100644
--- a/system/cron.py
+++ b/system/cron.py
@@ -460,7 +460,7 @@ class CronTab(object):
self.lines = newlines
- def render(self):
+ def render(self, diff=None):
"""
Render this crontab as it would be in the crontab.
"""
@@ -469,7 +469,7 @@ class CronTab(object):
crons.append(cron)
result = '\n'.join(crons)
- if result:
+ if result and not diff:
result = result.rstrip('\r\n') + '\n'
return result
@@ -586,7 +586,7 @@ def main():
if module._diff:
diff = dict()
- diff['before'] = crontab.render()
+ diff['before'] = crontab.render(diff=True)
if crontab.cron_file:
diff['before_header'] = crontab.cron_file
else: