From da7c849754566ec3ecf4709deeab6253a5bde135 Mon Sep 17 00:00:00 2001 From: Claire McQuin Date: Tue, 6 May 2014 15:22:10 -0700 Subject: convert cli argument to int, tidy exception message --- lib/chef/run_lock.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/chef/run_lock.rb') diff --git a/lib/chef/run_lock.rb b/lib/chef/run_lock.rb index 68f697bb2b..cefe637db6 100644 --- a/lib/chef/run_lock.rb +++ b/lib/chef/run_lock.rb @@ -46,6 +46,7 @@ class Chef @runlock_file = lockfile @runlock = nil @mutex = nil + @runpid = nil end # Acquire the system-wide lock. Will block indefinitely if another process @@ -151,6 +152,7 @@ class Chef def reset @runlock = nil @mutex = nil + @runpid = nil end # Since flock mechanism doesn't exist on windows we are using @@ -166,7 +168,7 @@ class Chef end def runpid - runlock.read.strip + @runpid ||= runlock.read.strip end def timeout_given? @@ -178,8 +180,9 @@ class Chef end def exit_from_timeout + rp = runpid release # Just to be on the safe side... - raise Chef::Exceptions::RunLockTimeout.new(time_to_wait, runpid) + raise Chef::Exceptions::RunLockTimeout.new(time_to_wait, rp) end end end -- cgit v1.2.1