From f0ea92cc7515c547ba3752a835b51ecb580fddf6 Mon Sep 17 00:00:00 2001 From: nextus Date: Wed, 13 Nov 2013 23:58:37 +0400 Subject: [PATCH 1/2] Fix: absent state removing whole cron.d file instead of specific job --- system/cron | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/cron b/system/cron index f877fc27214..b04fe23ea58 100644 --- a/system/cron +++ b/system/cron @@ -466,7 +466,7 @@ def main(): (backuph, backup_file) = tempfile.mkstemp(prefix='crontab') crontab.write(backup_file) - if crontab.cron_file and not do_install: + if crontab.cron_file and not name and not do_install: changed = crontab.remove_job_file() module.exit_json(changed=changed,cron_file=cron_file,state=state) From 6d701cb517baa9964098b8b29607a1c3e1ae5864 Mon Sep 17 00:00:00 2001 From: nextus Date: Thu, 14 Nov 2013 13:22:56 +0400 Subject: [PATCH 2/2] Don't allow cron module to delete cron_file without name parameter assignment --- system/cron | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/cron b/system/cron index b04fe23ea58..8f783d24c00 100644 --- a/system/cron +++ b/system/cron @@ -455,6 +455,9 @@ def main(): if job is None and do_install: module.fail_json(msg="You must specify 'job' to install a new cron job") + if job and name is None and not do_install: + module.fail_json(msg="You must specify 'name' to remove a cron job") + if reboot: if special_time: module.fail_json(msg="reboot and special_time are mutually exclusive")