def wait_for_image_state(state, ami, opts={})
      #First wait for the AMI to be confirmed to exist (after creating, an immediate query can cause an error)
      opts = parse_opts(opts, {:frequency => DEF_POLL_FREQ, :timeout => DEF_TIMEOUT})
      wait_with_timeout(opts[:frequency], opts[:timeout]){ ami.exists? }
      wait_with_timeout(opts[:frequency], opts[:timeout]){ ami.state == state }
    end
def wait_for_image_state(state, ami, opts={})
      #First wait for the AMI to be confirmed to exist (after creating, an immediate query can cause an error)
      opts = parse_opts(opts, {:frequency => DEF_POLL_FREQ, :timeout => DEF_TIMEOUT})
      wait_with_timeout(opts[:frequency], opts[:timeout]){ ami.exists? }
      wait_with_timeout(opts[:frequency], opts[:timeout]){ ami.state == state }
    end
Wait cycles