コード例 #1
0
 def _create_operation_log(self, operation_id):
     log_info = {
         'operation_id': operation_id,
         'state': 'in_progress',
     }
     log = objects.ScheduledOperationLog(self.context, **log_info)
     log.create()
     return log
コード例 #2
0
 def _create_operation_log(self, operation_id):
     log_info = {
         'operation_id': operation_id,
         'state': constants.OPERATION_EXE_STATE_IN_PROGRESS,
     }
     log = objects.ScheduledOperationLog(context.get_admin_context(),
                                         **log_info)
     log.create()
     return log
コード例 #3
0
    def _create_operation_log(self, param, updated_log_info=None):
        log_info = {
            'operation_id': param['operation_id'],
            'expect_start_time': param['expect_start_time'],
            'triggered_time': param['triggered_time'],
            'actual_start_time': datetime.utcnow(),
            'state': constants.OPERATION_EXE_STATE_IN_PROGRESS
        }
        if updated_log_info:
            log_info.update(updated_log_info)

        log_ref = objects.ScheduledOperationLog(context.get_admin_context(),
                                                **log_info)
        try:
            log_ref.create()
        except Exception:
            LOG.exception("Execute operation(%s), create log obj failed",
                          param['operation_id'])
            return
        return log_ref