Fixes #3791 cron always returning changed state for multiline jobs (#4285)

Strip only newlines and carriage returns. Instead of stripping ALL whitespace, which may have unintended side effects
reviewable/pr18780/r1
Evan Kaufman 8 years ago committed by René Moser
parent 7c4de52693
commit 4905ab66d6

@ -383,6 +383,9 @@ class CronTab(object):
return []
def get_cron_job(self,minute,hour,day,month,weekday,job,special,disabled):
# normalize any leading/trailing newlines (ansible/ansible-modules-core#3791)
job = job.strip('\r\n')
if disabled:
disable_prefix = '#'
else:

Loading…
Cancel
Save