Merge pull request #20433 from rallytime/bp-20386

Backport #20386 to 2014.7
This commit is contained in:
Nicole Thomas 2015-02-06 07:52:23 -07:00
commit debb844cca

View File

@ -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)