Only execute reboot check if guest communicator is ready

This commit is contained in:
Brian Cain 2018-11-02 16:33:36 -07:00
parent 142a6898bc
commit 377b900277
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
1 changed files with 2 additions and 1 deletions

View File

@ -38,7 +38,8 @@ module VagrantPlugins
def self.wait_for_reboot(machine)
script = File.expand_path("../../scripts/reboot_detect.ps1", __FILE__)
script = File.read(script)
while machine.communicate.execute(script, error_check: false, shell: :powershell) != 0
while machine.guest.ready? && machine.communicate.execute(script, error_check: false, shell: :powershell) != 0
sleep 10
end