Remove first three lines if starting with "DO NOT EDIT THIS FILE"

Patch for #10312
This commit is contained in:
muffl0n 2014-02-10 15:35:14 +01:00
parent 1de2a62733
commit 3e231304a5

View File

@ -136,8 +136,10 @@ def raw_cron(user):
cmd = 'crontab -l {0}'.format(user)
else:
cmd = 'crontab -l -u {0}'.format(user)
return __salt__['cmd.run_stdout'](cmd, rstrip=False)
lines = __salt__['cmd.run_stdout'](cmd, rstrip=False).splitlines()
if len(lines) != 0 and lines[0].startswith('# DO NOT EDIT THIS FILE - edit the master and reinstall.'):
del(lines[0:3])
return '\n'.join(lines)
def list_tab(user):
'''