summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-10-31 09:57:47 -0700
committerGitHub <noreply@github.com>2018-10-31 09:57:47 -0700
commit28cf9180a8bec30ec3dd16ff3086b0cd4df08c0b (patch)
tree62542c29f81fe5af30594ae071188cb954152eae
parentc7bcccedb380320f78d8ac4a2f74706a1c7f7e4e (diff)
parent462c52984d0e059c24d36038e801caa1a800bfb8 (diff)
downloadchef-28cf9180a8bec30ec3dd16ff3086b0cd4df08c0b.tar.gz
Merge pull request #7720 from MsysTechnologiesllc/dh/MSYS-889_chef_apply_crash_with_reboot
Fix chef-apply crash for reboot
-rw-r--r--lib/chef/application/apply.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/chef/application/apply.rb b/lib/chef/application/apply.rb
index 7325d89e1e..5b697703d7 100644
--- a/lib/chef/application/apply.rb
+++ b/lib/chef/application/apply.rb
@@ -191,10 +191,12 @@ class Chef::Application::Apply < Chef::Application
recipe, run_context = get_recipe_and_run_context
recipe.instance_eval(@recipe_text, @recipe_filename, 1)
runner = Chef::Runner.new(run_context)
- begin
- runner.converge
- ensure
- @recipe_fh.close
+ catch(:end_client_run_early) do
+ begin
+ runner.converge
+ ensure
+ @recipe_fh.close
+ end
end
Chef::Platform::Rebooter.reboot_if_needed!(runner)
end