From 8711362afb2a503aff4694a4975e52c0df083688 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 27 May 2008 09:40:21 +0000 Subject: [PATCH] ... --- PLC/Interfaces.py | 2 +- PLC/Methods/DeleteInterfaceSetting.py | 2 +- PLC/Methods/UpdateInterfaceSetting.py | 2 +- migrations/migrate-v4-to-v5.sql | 4 ++-- planetlab5.sql | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PLC/Interfaces.py b/PLC/Interfaces.py index 18016a6..ca1fe7e 100644 --- a/PLC/Interfaces.py +++ b/PLC/Interfaces.py @@ -65,7 +65,7 @@ class Interface(Row): 'hostname': Parameter(str, "(Optional) Hostname", nullok = True), 'node_id': Parameter(int, "Node associated with this interface"), 'is_primary': Parameter(bool, "Is the primary interface for this node"), - 'setting_ids' : Parameter([int], "List of interface settings"), + 'interface_setting_ids' : Parameter([int], "List of interface settings"), } def validate_method(self, method): diff --git a/PLC/Methods/DeleteInterfaceSetting.py b/PLC/Methods/DeleteInterfaceSetting.py index eda18e3..7037bc3 100644 --- a/PLC/Methods/DeleteInterfaceSetting.py +++ b/PLC/Methods/DeleteInterfaceSetting.py @@ -50,7 +50,7 @@ class DeleteInterfaceSetting(Method): raise PLCInvalidArgument, "No such interface %r"%interface_setting['interface_id'] interface = interfaces[0] - assert interface_setting['interface_setting_id'] in interface['setting_ids'] + assert interface_setting['interface_setting_id'] in interface['interface_setting_ids'] # check permission : it not admin, is the user affiliated with the right site if 'admin' not in self.caller['roles']: diff --git a/PLC/Methods/UpdateInterfaceSetting.py b/PLC/Methods/UpdateInterfaceSetting.py index cfefafc..b62c93b 100644 --- a/PLC/Methods/UpdateInterfaceSetting.py +++ b/PLC/Methods/UpdateInterfaceSetting.py @@ -48,7 +48,7 @@ class UpdateInterfaceSetting(Method): raise PLCInvalidArgument, "No such interface %r"%interface_setting['interface_id'] interface = interfaces[0] - assert interface_setting['interface_setting_id'] in interface['setting_ids'] + assert interface_setting['interface_setting_id'] in interface['interface_setting_ids'] # check permission : it not admin, is the user affiliated with the right site if 'admin' not in self.caller['roles']: diff --git a/migrations/migrate-v4-to-v5.sql b/migrations/migrate-v4-to-v5.sql index 0c9fb43..d5ada42 100644 --- a/migrations/migrate-v4-to-v5.sql +++ b/migrations/migrate-v4-to-v5.sql @@ -26,7 +26,7 @@ ALTER TABLE node_interfaces RENAME COLUMN nodenetwork_ids TO interface_ids; ALTER TABLE nodenetwork_settings RENAME TO interface_settings; ALTER TABLE interface_settings RENAME COLUMN nodenetwork_id TO interface_id; -ALTER TABLE interface_settings RENAME COLUMN nodenetwork_setting_ids TO setting_ids; +ALTER TABLE interface_settings RENAME COLUMN nodenetwork_setting_ids TO interface_setting_ids; ALTER TABLE view_nodenetwork_settings RENAME TO view_interface_settings; ALTER TABLE view_interface_settings RENAME COLUMN nodenetwork_setting_id TO interface_setting_id; @@ -35,7 +35,7 @@ ALTER TABLE view_interface_settings RENAME COLUMN nodenetwork_setting_type_id TO ALTER TABLE view_nodenetworks RENAME TO view_interfaces; ALTER TABLE view_interfaces RENAME COLUMN nodenetwork_id TO interface_id; -ALTER TABLE view_interfaces RENAME COLUMN nodenetwork_setting_ids TO setting_ids; +ALTER TABLE view_interfaces RENAME COLUMN nodenetwork_setting_ids TO interface_setting_ids; ALTER TABLE view_nodes RENAME COLUMN nodenetwork_ids TO interface_ids; diff --git a/planetlab5.sql b/planetlab5.sql index 382589f..0fd11aa 100644 --- a/planetlab5.sql +++ b/planetlab5.sql @@ -500,7 +500,7 @@ CREATE TABLE interface_setting ( CREATE OR REPLACE VIEW interface_settings AS SELECT interface_id, -array_accum(interface_setting_id) AS setting_ids +array_accum(interface_setting_id) AS interface_setting_ids FROM interface_setting GROUP BY interface_id; @@ -534,7 +534,7 @@ interfaces.dns1, interfaces.dns2, interfaces.bwlimit, interfaces.hostname, -COALESCE((SELECT setting_ids FROM interface_settings WHERE interface_settings.interface_id = interfaces.interface_id), '{}') AS setting_ids +COALESCE((SELECT interface_setting_ids FROM interface_settings WHERE interface_settings.interface_id = interfaces.interface_id), '{}') AS interface_setting_ids FROM interfaces; -------------------------------------------------------------------------------- -- 2.45.2