mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #20433 from rallytime/bp-20386
Backport #20386 to 2014.7
This commit is contained in:
commit
debb844cca
@ -213,11 +213,15 @@ def raw_cron(user):
|
||||
'''
|
||||
if __grains__.get('os_family') in ('Solaris', 'AIX'):
|
||||
cmd = 'crontab -l {0}'.format(user)
|
||||
lines = __salt__['cmd.run_stdout'](cmd,
|
||||
runas=user,
|
||||
rstrip=False,
|
||||
python_shell=False).splitlines()
|
||||
else:
|
||||
cmd = 'crontab -l -u {0}'.format(user)
|
||||
lines = __salt__['cmd.run_stdout'](cmd,
|
||||
rstrip=False,
|
||||
python_shell=False).splitlines()
|
||||
lines = __salt__['cmd.run_stdout'](cmd,
|
||||
rstrip=False,
|
||||
python_shell=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)
|
||||
|
Loading…
Reference in New Issue
Block a user