From bfa023f1ba3e962a1d2c0179b4209ce44c734506 Mon Sep 17 00:00:00 2001 From: Chris Doherty Date: Fri, 5 Sep 2014 17:45:08 -0700 Subject: Elaborate the specs a bit to make sure we're generating the correct reboot shell string. --- lib/chef/platform/rebooter.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/chef/platform/rebooter.rb') 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 -- cgit v1.2.1