/usr/lib/ruby/vendor_ruby/fog/core/wait_for.rb is in ruby-fog-core 1.45.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | module Fog
def self.wait_for(timeout = Fog.timeout, interval = Fog.interval, &_block)
duration = 0
start = Time.now
retries = 0
loop do
break if yield
if duration > timeout
raise Errors::TimeoutError, "The specified wait_for timeout (#{timeout} seconds) was exceeded"
end
sleep(interval.respond_to?(:call) ? interval.call(retries += 1).to_f : interval.to_f)
duration = Time.now - start
end
{ :duration => duration }
end
end
|