diff options
author | kaustubh-d <kaustubh@clogeny.com> | 2013-07-30 14:31:41 +0530 |
---|---|---|
committer | adamedx <adamed@opscode.com> | 2013-08-04 08:27:07 -0700 |
commit | bd547c7d8025e0daef0b9220f48d6079071dbab4 (patch) | |
tree | 981968f5160bf4f06e42d2941a1552569627d91a /lib/chef/provider/cron | |
parent | b0e12a56e1e31748aa9c6519e79fdd7e40d752d8 (diff) | |
download | chef-bd547c7d8025e0daef0b9220f48d6079071dbab4.tar.gz |
solaris9, 10 on some failures for example invalid mins in crontab fails with exit code of zero
Diffstat (limited to 'lib/chef/provider/cron')
-rw-r--r-- | lib/chef/provider/cron/unix.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/provider/cron/unix.rb b/lib/chef/provider/cron/unix.rb index 017a9f12ca..91df12d213 100644 --- a/lib/chef/provider/cron/unix.rb +++ b/lib/chef/provider/cron/unix.rb @@ -47,8 +47,13 @@ class Chef exit_status = 0 error_message = "" begin - status = run_command(:command => "/usr/bin/crontab #{tempcron.path}",:user => @new_resource.user) + status, stdout, stderr = run_command_and_return_stdout_stderr(:command => "/usr/bin/crontab #{tempcron.path}",:user => @new_resource.user) exit_status = status.exitstatus + # solaris9, 10 on some failures for example invalid 'mins' in crontab fails with exit code of zero :( + if stderr.include?("errors detected in input, no crontab file generated") + error_message = stderr + exit_status = 1 + end rescue Chef::Exceptions::Exec => e Chef::Log.debug(e.message) exit_status = 1 |