parameters: (hive, hive_names, timeout=2, max_attempts=5)
docstring: This waits for the shell prompt for each host in an effort to try to get
      them all to the same state. The timeout is set low so that hosts that are
      already at the prompt will not slow things down too much. If a prompt match
      is made for a hosts then keep asking until it stops matching. This is a
      best effort to consume all input if it printed more than one prompt. It's
      kind of kludgy. Note that this will always introduce a delay equal to the
      timeout for each machine. So for 10 machines with a 2 second delay you will
      get AT LEAST a 20 second delay if not more.
docstring_summary: This waits for the shell prompt for each host in an effort to try to get
      them all to the same state. The timeout is set low so that hosts that are
      already at the prompt will not slow things down too much. If a prompt match
      is made for a hosts then keep asking until it stops matching. This is a
      best effort to consume all input if it printed more than one prompt. It's
      kind of kludgy. Note that this will always introduce a delay equal to the
      timeout for each machine. So for 10 machines with a 2 second delay you will
      get AT LEAST a 20 second delay if not more.
docstring_tokens: This waits for the shell prompt for each host in an effort to try to get them all to the same state . The timeout is set low so that hosts that are already at the prompt will not slow things down too much . If a prompt match is made for a hosts then keep asking until it stops matching . This is a best effort to consume all input if it printed more than one prompt . It s kind of kludgy . Note that this will always introduce a delay equal to the timeout for each machine . So for 10 machines with a 2 second delay you will get AT LEAST a 20 second delay if not more .
function: def resync(hive, hive_names, timeout=2, max_attempts=5):
      """This waits for the shell prompt for each host in an effort to try to get
      them all to the same state. The timeout is set low so that hosts that are
      already at the prompt will not slow things down too much. If a prompt match
      is made for a hosts then keep asking until it stops matching. This is a
      best effort to consume all input if it printed more than one prompt. It's
      kind of kludgy. Note that this will always introduce a delay equal to the
      timeout for each machine. So for 10 machines with a 2 second delay you will
      get AT LEAST a 20 second delay if not more. """
  
      # TODO This is ideal for threading.
      for hostname in hive_names:
          for attempts in xrange(0, max_attempts):
              if not hive[hostname].prompt(timeout=timeout):
                  break
function_tokens: def resync ( hive , hive_names , timeout = 2 , max_attempts = 5 ) : # TODO This is ideal for threading. for hostname in hive_names : for attempts in xrange ( 0 , max_attempts ) : if not hive [ hostname ] . prompt ( timeout = timeout ) : break