diff options
author | Claire McQuin <claire@getchef.com> | 2014-05-06 15:22:10 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-05-06 15:22:10 -0700 |
commit | da7c849754566ec3ecf4709deeab6253a5bde135 (patch) | |
tree | 69ebf15b4ac08d621ef8376fc5e82fcdf1159db0 /lib/chef/run_lock.rb | |
parent | 07f57b179967f78976d75295abbae8ac6b7551b6 (diff) | |
download | chef-da7c849754566ec3ecf4709deeab6253a5bde135.tar.gz |
convert cli argument to int, tidy exception message
Diffstat (limited to 'lib/chef/run_lock.rb')
-rw-r--r-- | lib/chef/run_lock.rb | 7 |
1 files changed, 5 insertions, 2 deletions
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 |