def report_status(task, task_id, status):
 if (task in REPORT_TASKS):
  logging.debug('Sending task status to the AppScale Portal. Task: {0}, Status: {1}'.format(task, status))
  url = '{0}{1}'.format(hermes_constants.PORTAL_URL, hermes_constants.PORTAL_STATUS_PATH)
  data = urllib.urlencode({JSONTags.TASK_ID: task_id, JSONTags.DEPLOYMENT_ID: get_deployment_id(), JSONTags.STATUS: status})
  request = create_request(url=url, method='POST', body=data)
  for _ in range(REPORT_RETRIES):
   result = urlfetch(request)
   if result[JSONTags.SUCCESS]:
    delete_task_from_mem(task_id)
    return
  delete_task_from_mem(task_id)

def report_status ( task , task_id , status ) : if ( task in REPORT_TASKS ) : logging . debug ( 'Sending task status to the AppScale Portal. Task: {0}, Status: {1}' . format ( task , status ) ) url = '{0}{1}' . format ( hermes_constants . PORTAL_URL , hermes_constants . PORTAL_STATUS_PATH ) data = urllib . urlencode ( { JSONTags . TASK_ID : task_id , JSONTags . DEPLOYMENT_ID : get_deployment_id ( ) , JSONTags . STATUS : status } ) request = create_request ( url = url , method = 'POST' , body = data ) for _ in range ( REPORT_RETRIES ) : result = urlfetch ( request ) if result [ JSONTags . SUCCESS ] : delete_task_from_mem ( task_id ) return delete_task_from_mem ( task_id )
sends a status report for the given task to the appscale portal .