diff options
author | Chris Doherty <cdoherty@getchef.com> | 2014-09-05 17:45:08 -0700 |
---|---|---|
committer | Chris Doherty <cdoherty@getchef.com> | 2014-09-10 16:34:29 -0700 |
commit | bfa023f1ba3e962a1d2c0179b4209ce44c734506 (patch) | |
tree | a363ddadf988225c72192850ed444a92eb9993ab /lib/chef/platform/rebooter.rb | |
parent | 601ec3416004a62c7baef0f3cacf09d2c62f375e (diff) | |
download | chef-bfa023f1ba3e962a1d2c0179b4209ce44c734506.tar.gz |
Elaborate the specs a bit to make sure we're generating the correct reboot shell string.
Diffstat (limited to 'lib/chef/platform/rebooter.rb')
-rw-r--r-- | lib/chef/platform/rebooter.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/chef/platform/rebooter.rb b/lib/chef/platform/rebooter.rb index d471b3838e..75213b3fc7 100644 --- a/lib/chef/platform/rebooter.rb +++ b/lib/chef/platform/rebooter.rb @@ -20,7 +20,6 @@ require 'chef/dsl/reboot_pending' require 'chef/log' require 'chef/platform' -# this has whatever's needed to reboot the server, on whichever platform. class Chef class Platform module Rebooter @@ -33,10 +32,9 @@ class Chef cmd = if Chef::Platform.windows? "shutdown /r /t #{reboot_info[:delay_mins]} /c \"#{reboot_info[:reason]}\"" else - shutdown_time = reboot_info[:delay_mins] > 0 ? reboot_info[:reboot_timeout] : "now" - "shutdown -r #{shutdown_time}" + # probably Linux-only. + "shutdown -r +#{reboot_info[:delay_mins]} \"#{reboot_info[:reason]}\"" end - Chef::Log.warn "Shutdown command (not running): '#{cmd}'" shell_out!(cmd) end @@ -49,7 +47,7 @@ class Chef reboot! end end - end # end class instance stuff. + end end end end |