summaryrefslogtreecommitdiff
path: root/lib/chef/application.rb
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2014-07-03 20:20:03 -0700
committerJohn Keiser <jkeiser@opscode.com>2014-07-07 10:04:59 -0700
commit4f6488026bed45da624812de6985b1168b2358b2 (patch)
tree86cfb1945fce1fc061c64a37d8ab0da2495fab44 /lib/chef/application.rb
parentb658f99957b24bfdf72fb340336d0348fdaf70f5 (diff)
downloadchef-4f6488026bed45da624812de6985b1168b2358b2.tar.gz
Refactor caller decorations into with_server_connectivity
Diffstat (limited to 'lib/chef/application.rb')
-rw-r--r--lib/chef/application.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/chef/application.rb b/lib/chef/application.rb
index b1d28f618c..5b404a3a50 100644
--- a/lib/chef/application.rb
+++ b/lib/chef/application.rb
@@ -187,9 +187,7 @@ class Chef::Application
# Initializes Chef::Client instance and runs it
def run_chef_client(specific_recipes = [])
- Chef::LocalMode.setup_server_connectivity
-
- begin
+ Chef::LocalMode.with_server_connectivity do
override_runlist = config[:override_runlist]
if specific_recipes.size > 0
override_runlist ||= []
@@ -204,8 +202,6 @@ class Chef::Application
@chef_client.run
@chef_client = nil
- ensure
- Chef::LocalMode.destroy_server_connectivity
end
end