summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy McCrory <jimmy.mccrory@gmail.com>2015-07-19 01:33:52 -0700
committerJimmy McCrory <jmccrory@walmartlabs.com>2015-07-19 01:40:56 -0700
commit704774b3d05273b9fdfbc45cf464a6f1f00c4d10 (patch)
tree1190cb5f4c7db361527c428fcc11e91d5f58544e
parentecb66fe3ff773ad6232248ad616b0488e1b13674 (diff)
downloadchef-704774b3d05273b9fdfbc45cf464a6f1f00c4d10.tar.gz
Correct Windows reboot command to delay in minutes
Correct the command used to reboot Windows machines so that it converts a given delay_mins option to the appropriate number of seconds.
-rw-r--r--lib/chef/platform/rebooter.rb2
-rw-r--r--spec/functional/rebooter_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/platform/rebooter.rb b/lib/chef/platform/rebooter.rb
index b46f0e394c..b78ac38f0c 100644
--- a/lib/chef/platform/rebooter.rb
+++ b/lib/chef/platform/rebooter.rb
@@ -32,7 +32,7 @@ class Chef
cmd = if Chef::Platform.windows?
# should this do /f as well? do we then need a minimum delay to let apps quit?
- "shutdown /r /t #{reboot_info[:delay_mins]} /c \"#{reboot_info[:reason]}\""
+ "shutdown /r /t #{reboot_info[:delay_mins]*60} /c \"#{reboot_info[:reason]}\""
else
# probably Linux-only.
"shutdown -r +#{reboot_info[:delay_mins]} \"#{reboot_info[:reason]}\""
diff --git a/spec/functional/rebooter_spec.rb b/spec/functional/rebooter_spec.rb
index 485e98f247..a0e2665de5 100644
--- a/spec/functional/rebooter_spec.rb
+++ b/spec/functional/rebooter_spec.rb
@@ -43,7 +43,7 @@ describe Chef::Platform::Rebooter do
let(:expected) do
{
- :windows => 'shutdown /r /t 5 /c "rebooter spec test"',
+ :windows => 'shutdown /r /t 300 /c "rebooter spec test"',
:linux => 'shutdown -r +5 "rebooter spec test"'
}
end