Skip to content

Commit

Permalink
Merge pull request saltstack#2260 from romeotheriault/fix-solaris-cro…
Browse files Browse the repository at this point in the history
…n-for-non-root-users

fix for cron on solaris with non-root user
  • Loading branch information
thatch45 committed Oct 16, 2012
2 parents de49cef + 9f717dd commit 78dcd9a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions salt/modules/cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def _write_cron_lines(user, lines):
os.close(fd_)
with open(path, 'w+') as fp_:
fp_.writelines(lines)
if __grains__['os'] == 'Solaris' and user != "root":
__salt__['cmd.run']('chown {0} {1}'.format(user, path))
ret = __salt__['cmd.run_all'](_get_cron_cmdstr(user, path))
os.remove(path)
return ret
Expand Down

0 comments on commit 78dcd9a

Please sign in to comment.