def execute(self, context, checkpoint, checkpoint_copy, operation_log, *args, **kwargs): LOG.debug("Initiate copy checkpoint_id: %s", checkpoint_copy.id) checkpoint_copy.status = constants.CHECKPOINT_STATUS_COPYING checkpoint_copy.commit() update_fields = {"status": checkpoint_copy.status} utils.update_operation_log(context, operation_log, update_fields)
def execute(self, context, checkpoint, operation_log): LOG.debug("Complete delete checkpoint_id: %s", checkpoint.id) checkpoint.delete() update_fields = { "status": checkpoint.status, "ended_at": timeutils.utcnow() } utils.update_operation_log(context, operation_log, update_fields)
def execute(self, context, restore, operation_log, *args, **kwargs): LOG.debug("Complete restore restore_id: %s", restore.id) restore['status'] = constants.RESTORE_STATUS_SUCCESS restore.save() update_fields = { "status": restore.status, "ended_at": timeutils.utcnow() } utils.update_operation_log(context, operation_log, update_fields)
def revert(self, context, restore, operation_log, *args, **kwargs): LOG.debug("Failed to restore restore_id: %s", restore.id) restore['status'] = constants.RESTORE_STATUS_FAILURE restore.save() update_fields = { "status": restore.status, "ended_at": timeutils.utcnow() } utils.update_operation_log(context, operation_log, update_fields)
def execute(self, context, verify, operation_log, *args, **kwargs): LOG.debug("Complete verify verify_id: %s", verify.id) verify['status'] = constants.VERIFICATION_STATUS_SUCCESS verify.save() update_fields = { "status": verify.status, "ended_at": timeutils.utcnow() } utils.update_operation_log(context, operation_log, update_fields)
def revert(self, context, verify, operation_log, *args, **kwargs): LOG.debug("Failed to verify verify_id: %s", verify.id) verify['status'] = constants.VERIFICATION_STATUS_FAILURE verify.save() update_fields = { "status": verify.status, "ended_at": timeutils.utcnow() } utils.update_operation_log(context, operation_log, update_fields)
def execute(self, context, checkpoint, operation_log): LOG.debug("Complete protect checkpoint_id: %s", checkpoint.id) checkpoint.status = constants.CHECKPOINT_STATUS_AVAILABLE checkpoint.commit() update_fields = { "status": checkpoint.status, "ended_at": timeutils.utcnow() } utils.update_operation_log(context, operation_log, update_fields)
def revert(self, context, checkpoint, operation_log, *args, **kwargs): LOG.debug("Failed to protect checkpoint_id: %s", checkpoint.id) checkpoint.status = constants.CHECKPOINT_STATUS_ERROR checkpoint.commit() update_fields = { "status": checkpoint.status, "ended_at": timeutils.utcnow() } utils.update_operation_log(context, operation_log, update_fields)
def execute(self, context, checkpoint, checkpoint_copy, operation_log): LOG.debug("Complete copy checkpoint_id: %s", checkpoint_copy.id) checkpoint_copy.status = constants.CHECKPOINT_STATUS_AVAILABLE if checkpoint_copy.extra_info: extra_info = jsonutils.loads(checkpoint_copy.extra_info) extra_info['copy_status'] = \ constants.CHECKPOINT_STATUS_COPY_FINISHED else: extra_info = { 'copy_status': constants.CHECKPOINT_STATUS_COPY_FINISHED } checkpoint_copy.extra_info = jsonutils.dumps(extra_info) checkpoint_copy.commit() update_fields = { "status": checkpoint_copy.status, "ended_at": timeutils.utcnow() } utils.update_operation_log(context, operation_log, update_fields)
def execute(self, context, restore, operation_log, *args, **kwargs): LOG.debug("Initiate restore restore_id: %s", restore.id) restore['status'] = constants.RESTORE_STATUS_IN_PROGRESS restore.save() update_fields = {"status": restore.status} utils.update_operation_log(context, operation_log, update_fields)
def execute(self, context, verify, operation_log, *args, **kwargs): LOG.debug("Initiate verify verify_id: %s", verify.id) verify['status'] = constants.VERIFICATION_STATUS_IN_PROGRESS verify.save() update_fields = {"status": verify.status} utils.update_operation_log(context, operation_log, update_fields)