summaryrefslogtreecommitdiff
path: root/lib/chef/client.rb
diff options
context:
space:
mode:
authorGregoire Seux <g.seux@criteo.com>2013-03-22 11:08:59 +0100
committerBryan McLellan <btm@opscode.com>2013-04-11 13:38:30 -0700
commitb02e6d25b18e87a416b8672baca7d30621c01583 (patch)
tree2b127eb2b2c46b2996f21c73f7de660fe71c4669 /lib/chef/client.rb
parentcecfe75c82a2977f04cd34abb71996c5acd80273 (diff)
downloadchef-b02e6d25b18e87a416b8672baca7d30621c01583.tar.gz
CHEF-4010 Ensure lock release for all operations
Diffstat (limited to 'lib/chef/client.rb')
-rw-r--r--lib/chef/client.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index 010f08acac..d1b368b9a4 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -444,18 +444,18 @@ class Chef
def do_run
runlock = RunLock.new(Chef::Config)
runlock.acquire
+ # don't add code that may fail before entering this section to be sure to release lock
+ begin
+ run_context = nil
+ @events.run_start(Chef::VERSION)
+ Chef::Log.info("*** Chef #{Chef::VERSION} ***")
+ enforce_path_sanity
+ run_ohai
+ @events.ohai_completed(node)
+ register unless Chef::Config[:solo]
- run_context = nil
- @events.run_start(Chef::VERSION)
- Chef::Log.info("*** Chef #{Chef::VERSION} ***")
- enforce_path_sanity
- run_ohai
- @events.ohai_completed(node)
- register unless Chef::Config[:solo]
-
- load_node
+ load_node
- begin
build_node
run_status.start_clock