def test_scheduled_operation_log_update(self): log_ref = self._create_scheduled_operation_log() log_id = log_ref['id'] log_ref = db.scheduled_operation_log_update(self.ctxt, log_id, {"state": "success"}) self.assertEqual('success', log_ref['state']) log_ref = db.scheduled_operation_log_get(self.ctxt, log_id) self.assertEqual('success', log_ref['state']) self.assertRaises(exception.ScheduledOperationLogNotFound, db.scheduled_operation_log_update, self.ctxt, 100, {"state": "success"})
def save(self): updates = self.karbor_obj_get_changes() if updates and self.id is not None: db.scheduled_operation_log_update(self._context, self.id, updates) self.obj_reset_changes()