Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def update_crontab(jobs=None):
if jobs is None:
jobs = []
for job in get_jobs():
jobs.append(job)
new_crontab = crontab.update_crontab(jobs)
if app.config['DEBUG']:
print "Debug mode, would have updated crontab to:"
print new_crontab
else:
crontab.save_crontab(new_crontab)