mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Remove first three lines if starting with "DO NOT EDIT THIS FILE"
Patch for #10312
This commit is contained in:
parent
1de2a62733
commit
3e231304a5
@ -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):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user