diff options
author | Tim Smith <tsmith@chef.io> | 2018-10-31 14:14:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-31 14:14:02 -0700 |
commit | 72840d11042660e84e3118d1ae5e4643c6336e58 (patch) | |
tree | 25f8f2f978fbd9cd2fe228d00cd7f472975fd85f | |
parent | c30fe10c6912d11e3e9918935e3d73db705ad32a (diff) | |
parent | e35e51e71f946949eca3d033aa64b8c6e8767598 (diff) | |
download | chef-72840d11042660e84e3118d1ae5e4643c6336e58.tar.gz |
Merge pull request #7828 from chef/chef_apply_14
Backport: Fix chef-apply crash for reboot
-rw-r--r-- | lib/chef/application/apply.rb | 10 |
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 |