def flush_result_data(self):
    if (self.target == ''):
        LOG.error('Dispatcher target was not set, no data willbe posted.')
        return
    self.result['details'] = self.raw_result
    case_name = ''
    for v in self.raw_result:
        if (isinstance(v, dict) and ('scenario_cfg' in v)):
            case_name = v['scenario_cfg']['tc']
            break
    if (case_name == ''):
        LOG.error('Test result : %s', jsonutils.dump_as_bytes(self.result))
        LOG.error('The case_name cannot be found, no data will be posted.')
        return
    self.result['case_name'] = case_name
    try:
        LOG.debug('Test result : %s', jsonutils.dump_as_bytes(self.result))
        res = requests.post(self.target, data=jsonutils.dump_as_bytes(self.result), headers=self.headers, timeout=self.timeout)
        LOG.debug(('Test result posting finished with status code %d.' % res.status_code))
    except Exception as err:
        LOG.exception('Failed to record result data: %s', err)
def flush_result_data(self):
    if (self.target == ):
        LOG.error('Dispatcher target was not set, no data willbe posted.')
        return
    self.result['details'] = self.raw_result
    case_name = 
    for v in self.raw_result:
        if (isinstance(v, dict) and ('scenario_cfg' in v)):
            case_name = v['scenario_cfg']['tc']
            break
    if (case_name == ):
        LOG.error('Test result : %s', jsonutils.dump_as_bytes(self.result))
        LOG.error('The case_name cannot be found, no data will be posted.')
        return
    self.result['case_name'] = case_name
    try:
        LOG.debug('Test result : %s', jsonutils.dump_as_bytes(self.result))
        res = requests.post(self.target, data=jsonutils.dump_as_bytes(self.result), headers=self.headers, timeout=self.timeout)
        LOG.debug(('Test result posting finished with status code %d.' % res.status_code))
    except Exception as err:
        LOG.exception('Failed to record result data: %s', err)