Merge pull request #27231 from jfindlay/cronchange

only write cron file if it is changed
This commit is contained in:
Mike Place 2015-09-18 12:23:09 -06:00
commit 26540f15bc

View file

@ -524,13 +524,13 @@ def file(name,
return ret
if ret['changes']:
cron_ret = __salt__['cron.write_cron_file_verbose'](user, cron_path)
ret['changes'] = {'diff': ret['changes']['diff']}
ret['comment'] = 'Crontab for user {0} was updated'.format(user)
elif ret['result']:
ret['comment'] = 'Crontab for user {0} is in the correct ' \
'state'.format(user)
cron_ret = __salt__['cron.write_cron_file_verbose'](user, cron_path)
if cron_ret['retcode']:
ret['comment'] = 'Unable to update user {0} crontab {1}.' \
' Error: {2}'.format(user, cron_path, cron_ret['stderr'])