Improved fix for the newline at the end of crontabs

Fixes issue #15699 and improves PR #15771
This commit is contained in:
Jille Timmermans 2014-09-18 13:16:04 +02:00
parent 67b13d9c05
commit a71a8fb96d

View File

@ -426,7 +426,7 @@ def file(name,
with salt.utils.fopen(cron_path, 'w+') as fp_:
raw_cron = __salt__['cron.raw_cron'](user)
if not raw_cron.endswith('\n'):
raw_cron = '{0}'.format(raw_cron)
raw_cron = "{0}\n".format(raw_cron)
fp_.write(raw_cron)
ret = {'changes': {},