From 580c74140a9d8109d4fa44e372895ea4e5ed4ee4 Mon Sep 17 00:00:00 2001 From: Evan Kaufman Date: Fri, 2 Dec 2016 00:49:48 -0800 Subject: [PATCH] Fix for python 2.4 compatibility (#5693) Fixes #5692 --- lib/ansible/modules/system/cron.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/system/cron.py b/lib/ansible/modules/system/cron.py index 78492109ad..36213092f9 100644 --- a/lib/ansible/modules/system/cron.py +++ b/lib/ansible/modules/system/cron.py @@ -727,8 +727,9 @@ def main(): changed = True # no changes to env/job, but existing crontab needs a terminating newline - if not changed and not crontab.existing.endswith(('\r', '\n')): - changed = True + if not changed: + if not (crontab.existing.endswith('\r') or crontab.existing.endswith('\n')): + changed = True res_args = dict( jobs = crontab.get_jobnames(),