thread.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:functest 作者: opnfv 项目源码 文件源码
def run(self):
        """ Override the function run: run testcase and update database """
        update_data = {'task_id': self.args.get('task_id'),
                       'status': 'IN PROGRESS'}
        self.handler.insert(update_data)

        LOGGER.info('Starting running test case')

        try:
            data = self.target(self.args)
        except Exception as err:  # pylint: disable=broad-except
            LOGGER.exception('Task Failed')
            update_data = {'status': 'FAIL', 'error': str(err)}
            self.handler.update_attr(self.args.get('task_id'), update_data)
        else:
            LOGGER.info('Task Finished')
            LOGGER.debug('Result: %s', data)
            new_data = {'status': 'FINISHED',
                        'result': jsonutils.dumps(data.get('result', {}))}

            self.handler.update_attr(self.args.get('task_id'), new_data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号