summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/windows.rb4
-rw-r--r--lib/chef/resource/hostname.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
index 22f78db319..df176e8751 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
@@ -68,3 +68,7 @@ locale "set system locale" do
end
include_recipe "::_ohai_hint"
+
+hostname "new-hostname" do
+ windows_reboot false
+end \ No newline at end of file
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index dcf7354446..793006096d 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -248,8 +248,8 @@ class Chef
# reboot because $windows
reboot "setting hostname" do
reason "#{Chef::Dist::PRODUCT} updated system hostname"
- action :nothing
only_if { new_resource.windows_reboot }
+ action :request_reboot
end
end
end