Add rm_special to crontab module

Closes #28171
This commit is contained in:
Mike Place 2015-12-30 14:46:14 -07:00
parent a3410fdf41
commit ad9424820e

View file

@ -479,6 +479,24 @@ def set_job(user,
return 'new'
def rm_special(user, special, cmd):
lst = list_tab(user)
ret = 'absent'
rm_ = None
for ind in range(len(lst['special'])):
if lst['special'][ind]['cmd'] == cmd and \
lst['special'][ind]['spec'] == special:
lst['special'].pop(ind)
rm_ = ind
if rm_ is not None:
ret = 'removed'
comdat = _write_cron_lines(user, _render_tab(lst))
if comdat['retcode']:
# Failed to commit
return comdat['stderr']
return ret
def rm_job(user,
cmd,
minute=None,