From: Thierry Parmentelat Date: Tue, 27 May 2008 09:40:21 +0000 (+0000) Subject: ... X-Git-Tag: PLCAPI-4.3-1~51 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8711362afb2a503aff4694a4975e52c0df083688;p=plcapi.git ... --- diff --git a/PLC/Interfaces.py b/PLC/Interfaces.py index 18016a63..ca1fe7e0 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 eda18e32..7037bc3b 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 cfefafc0..b62c93ba 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 0c9fb437..d5ada42c 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 382589fb..0fd11aad 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; --------------------------------------------------------------------------------