From 2dfe520eb833110180881eb6409e8b1ce1696913 Mon Sep 17 00:00:00 2001 From: Adam Paul Date: Thu, 15 Mar 2018 11:45:42 -0400 Subject: [PATCH] add capability test before attemping to use capability --- plugins/guests/windows/cap/change_host_name.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/guests/windows/cap/change_host_name.rb b/plugins/guests/windows/cap/change_host_name.rb index 627649caf..f33e2e84c 100644 --- a/plugins/guests/windows/cap/change_host_name.rb +++ b/plugins/guests/windows/cap/change_host_name.rb @@ -28,7 +28,9 @@ module VagrantPlugins error_key: :rename_computer_failed) # Don't continue until the machine has shutdown and rebooted - machine.guest.capability(:wait_for_reboot) + if machine.guest.capability?(:wait_for_reboot) + machine.guest.capability(:wait_for_reboot) + end end end end