def resync(hive, hive_names, timeout=2, max_attempts=5):
 for hostname in hive_names:
  if (hive[hostname] is not None):
   for attempts in range(0, max_attempts):
    if (not hive[hostname].prompt(timeout=timeout)):
     break

def resync ( hive , hive_names , timeout = 2 , max_attempts = 5 ) : for hostname in hive_names : if ( hive [ hostname ] is not None ) : for attempts in range ( 0 , max_attempts ) : if ( not hive [ hostname ] . prompt ( timeout = timeout ) ) : break
this waits for the shell prompt for each host in an effort to try to get them all to the same state .