def wait_for_task(uuid, start_wait = 0, delta_wait = 1, max_wait = 10)
wait_time = start_wait
if option_quiet?
info "Waiting for the task [#{uuid}] "
else
print "Waiting for the task [#{uuid}] "
end
loop do
sleep wait_time
wait_time = [wait_time + delta_wait, max_wait].min
print '.' unless option_quiet?
STDOUT.flush unless option_quiet?
task = api_call(:foreman_tasks, :show, {:id => uuid})
next unless task['state'] == 'stopped'
print "\n" unless option_quiet?
return task['return'] == 'success'
end
end