summaryrefslogtreecommitdiff
path: root/lib/chef/client.rb
diff options
context:
space:
mode:
authorChris Doherty <cdoherty@ooyala.com>2014-09-02 09:14:04 -0700
committerChris Doherty <cdoherty@getchef.com>2014-09-10 16:34:14 -0700
commitda7dddf3d43fffbc38fd48296eb5d4d34467e22d (patch)
tree600920b617a4b9a46b541ab5bf150b7e53f4d9f5 /lib/chef/client.rb
parent6ef555bed751f2b8dac01391fdff2c527d947545 (diff)
downloadchef-da7dddf3d43fffbc38fd48296eb5d4d34467e22d.tar.gz
First-pass changes for a core reboot resource. Still uses run_state instead of run_context.
Diffstat (limited to 'lib/chef/client.rb')
-rw-r--r--lib/chef/client.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index 2de3ca3e64..4aeecd03c2 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -44,6 +44,7 @@ require 'chef/resource_reporter'
require 'chef/run_lock'
require 'chef/policy_builder'
require 'chef/request_id'
+require 'chef/rebooter'
require 'ohai'
require 'rbconfig'
@@ -435,6 +436,10 @@ class Chef
Chef::Log.info("Chef Run complete in #{run_status.elapsed_time} seconds")
run_completed_successfully
@events.run_completed(node)
+
+ # rebooting has to be the last thing we do, no exceptions.
+ Chef::Rebooter.reboot_if_needed!(node)
+
true
rescue Exception => e
# CHEF-3336: Send the error first in case something goes wrong below and we don't know why