From 76551a1692250ba948abb3c07b94784ffb85ff29 Mon Sep 17 00:00:00 2001 From: Adam Paul Date: Thu, 15 Mar 2018 10:38:07 -0400 Subject: [PATCH] Fix graceful_halt_timeout issue #8486 --- plugins/guests/windows/cap/change_host_name.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/guests/windows/cap/change_host_name.rb b/plugins/guests/windows/cap/change_host_name.rb index fa48a3137..627649caf 100644 --- a/plugins/guests/windows/cap/change_host_name.rb +++ b/plugins/guests/windows/cap/change_host_name.rb @@ -4,10 +4,10 @@ module VagrantPlugins module ChangeHostName def self.change_host_name(machine, name) - change_host_name_and_wait(machine, name, machine.config.vm.graceful_halt_timeout) + change_host_name_and_wait(machine, name) end - def self.change_host_name_and_wait(machine, name, sleep_timeout) + def self.change_host_name_and_wait(machine, name) # If the configured name matches the current name, then bail # We cannot use %ComputerName% because it truncates at 15 chars return if machine.communicate.test("if ([System.Net.Dns]::GetHostName() -eq '#{name}') { exit 0 } exit 1") @@ -28,7 +28,7 @@ module VagrantPlugins error_key: :rename_computer_failed) # Don't continue until the machine has shutdown and rebooted - sleep(sleep_timeout) + machine.guest.capability(:wait_for_reboot) end end end