summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordheerajd-msys <dheeraj.dubey@msystechnologies.com>2018-10-04 17:21:28 +0530
committerTim Smith <tsmith@chef.io>2018-10-31 12:40:06 -0700
commite35e51e71f946949eca3d033aa64b8c6e8767598 (patch)
tree5dbb773cacf60fe082e3c8d94067faa2e825e81e
parent36b8f51ad6a745647a999c6ec5d5ebd721c11c6b (diff)
downloadchef-e35e51e71f946949eca3d033aa64b8c6e8767598.tar.gz
fix chef-apply crash for reboot
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
-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