From 4e8e897e1c15c58ac32a4ad1aebd60ada96479de Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 16 Feb 2018 00:07:36 +0100 Subject: bug: Fix model according to new schema These changes fixes the `machine_state` model to use the new schema where a machine can run multiple tasks at the same time. --- opendc/models/machine_state.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/opendc/models/machine_state.py b/opendc/models/machine_state.py index 7f19ba01..1da37c80 100644 --- a/opendc/models/machine_state.py +++ b/opendc/models/machine_state.py @@ -6,7 +6,6 @@ class MachineState(Model): JSON_TO_PYTHON_DICT = { 'MachineState': { 'taskId': 'task_id', - 'machineId': 'machine_id', 'temperatureC': 'temperature_c', 'inUseMemoryMb': 'in_use_memory_mb', 'loadFraction': 'load_fraction', @@ -15,7 +14,7 @@ class MachineState(Model): } TABLE_NAME = 'machine_states' - COLUMNS = ['id', 'task_id', 'machine_id', 'experiment_id', 'tick', 'temperature_c', 'in_use_memory_mb', + COLUMNS = ['id', 'task_id', 'experiment_id', 'tick', 'temperature_c', 'in_use_memory_mb', 'load_fraction'] COLUMNS_PRIMARY_KEY = ['id'] @@ -26,11 +25,10 @@ class MachineState(Model): return cls( task_id=row[1], - machine_id=row[2], - temperature_c=row[5], - in_use_memory_mb=row[6], - load_fraction=row[7], - tick=row[4] + temperature_c=row[4], + in_use_memory_mb=row[5], + load_fraction=row[6], + tick=row[3] ) @classmethod -- cgit v1.2.3