def wait_for_machine_to_recover(host, hours_to_wait=HOURS_TO_WAIT):
 current_time = time.strftime('%b %d %H:%M:%S', time.localtime())
 if host.is_up():
  logging.info('%s already up, collecting crash info', host.hostname)
  return True
 if (hours_to_wait > 0):
  logging.info('Waiting %s hours for %s to come up (%s)', hours_to_wait, host.hostname, current_time)
  if (not host.wait_up(timeout=(hours_to_wait * 3600))):
   logging.warning('%s down, unable to collect crash info', host.hostname)
   return False
  else:
   logging.info('%s is back up, collecting crash info', host.hostname)
   return True
 else:
  logging.info('Skipping crash info collection')
  return False

def wait_for_machine_to_recover ( host , hours_to_wait = HOURS_TO_WAIT ) : current_time = time . strftime ( '%b %d %H:%M:%S' , time . localtime ( ) ) if host . is_up ( ) : logging . info ( '%s already up, collecting crash info' , host . hostname ) return True if ( hours_to_wait > 0 ) : logging . info ( 'Waiting %s hours for %s to come up (%s)' , hours_to_wait , host . hostname , current_time ) if ( not host . wait_up ( timeout = ( hours_to_wait * 3600 ) ) ) : logging . warning ( '%s down, unable to collect crash info' , host . hostname ) return False else : logging . info ( '%s is back up, collecting crash info' , host . hostname ) return True else : logging . info ( 'Skipping crash info collection' ) return False
wait for a machine to become accessible again .