From c364e4c77bf6f3ef0dbfefa1dc24218e93961eff Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Thu, 21 Feb 2013 21:14:29 +0100 Subject: [PATCH] cron: Work even without initial crontab Fixes #2165. --- library/cron | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/cron b/library/cron index 51a8abf2933..7d0ef5db4c0 100644 --- a/library/cron +++ b/library/cron @@ -333,12 +333,9 @@ def main(): os.unlink(backupfile) module.exit_json(changed=changed,cron_file=cron_file,state=state) - if (rc != 0): - module.fail_json(msg=err) - if changed: # If the file is empty - remove it - if rm: + if rm and cron_file: remove_job_file(cron_file) else: if backup: