From 44f0bd378763f4c481fb8a87847ca84469b35a67 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 26 Sep 2017 17:10:06 +0200 Subject: Copy over topology_ids on branch --- opendc/models/machine.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'opendc/models/machine.py') diff --git a/opendc/models/machine.py b/opendc/models/machine.py index 0d9fbd54..f233d329 100644 --- a/opendc/models/machine.py +++ b/opendc/models/machine.py @@ -15,14 +15,15 @@ class Machine(Model): 'cpuIds': 'cpu_ids', 'gpuIds': 'gpu_ids', 'memoryIds': 'memory_ids', - 'storageIds': 'storage_ids' + 'storageIds': 'storage_ids', + 'topologyId': 'topology_id' } } PATH = '/v1/tiles/{tileId}/rack/machines' TABLE_NAME = 'machines' - COLUMNS = ['id', 'rack_id', 'position'] + COLUMNS = ['id', 'rack_id', 'position', 'topology_id'] COLUMNS_PRIMARY_KEY = ['id'] device_table_to_attribute = { @@ -37,11 +38,6 @@ class Machine(Model): for device_table in self.device_table_to_attribute.keys(): - # First, create the statements to execute - - statements = [] - values = [] - # First, delete current machine-device links statement = 'DELETE FROM machine_{} WHERE machine_id = %s'.format(device_table) -- cgit v1.2.3