def _wait_for_status(linode_id, status=None, timeout=300, quiet=True):
 if (status is None):
  status = _get_status_id_by_name('brand_new')
 status_desc_waiting = _get_status_descr_by_id(status)
 interval = 5
 iterations = int((timeout / interval))
 for i in range(0, iterations):
  result = get_linode(kwargs={'linode_id': linode_id})
  if (result['STATUS'] == status):
   return True
  status_desc_result = _get_status_descr_by_id(result['STATUS'])
  time.sleep(interval)
  if quiet:
   log.info("Status for Linode {0} is '{1}', waiting for '{2}'.".format(linode_id, status_desc_result, status_desc_waiting))
  else:
   log.debug("Status for Linode {0} is '{1}', waiting for '{2}'.".format(linode_id, status_desc_result, status_desc_waiting))
 return False

def _wait_for_status ( linode_id , status = None , timeout = 300 , quiet = True ) : if ( status is None ) : status = _get_status_id_by_name ( 'brand_new' ) status_desc_waiting = _get_status_descr_by_id ( status ) interval = 5 iterations = int ( ( timeout / interval ) ) for i in range ( 0 , iterations ) : result = get_linode ( kwargs = { 'linode_id' : linode_id } ) if ( result [ 'STATUS' ] == status ) : return True status_desc_result = _get_status_descr_by_id ( result [ 'STATUS' ] ) time . sleep ( interval ) if quiet : log . info ( "Status for Linode {0} is '{1}', waiting for '{2}'." . format ( linode_id , status_desc_result , status_desc_waiting ) ) else : log . debug ( "Status for Linode {0} is '{1}', waiting for '{2}'." . format ( linode_id , status_desc_result , status_desc_waiting ) ) return False
wait for a certain status from linode .