From 25ca2c2fee216af894640248b6d83939f31ca327 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 11 Dec 2008 07:54:15 +0000 Subject: [PATCH] cleanup - make node/interface/slice similar --- PLC/Methods/DeleteNodeTag.py | 2 +- PLC/Methods/UpdateNodeTag.py | 2 +- PLC/Nodes.py | 2 +- planetlab5.sql | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PLC/Methods/DeleteNodeTag.py b/PLC/Methods/DeleteNodeTag.py index 75de911..97140e9 100644 --- a/PLC/Methods/DeleteNodeTag.py +++ b/PLC/Methods/DeleteNodeTag.py @@ -51,7 +51,7 @@ class DeleteNodeTag(Method): raise PLCInvalidArgument, "No such node %r"%node_tag['node_id'] node = nodes[0] - assert node_tag['node_tag_id'] in node['tag_ids'] + assert node_tag['node_tag_id'] in node['node_tag_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/UpdateNodeTag.py b/PLC/Methods/UpdateNodeTag.py index 16123c6..cb7a6a5 100644 --- a/PLC/Methods/UpdateNodeTag.py +++ b/PLC/Methods/UpdateNodeTag.py @@ -47,7 +47,7 @@ class UpdateNodeTag(Method): raise PLCInvalidArgument, "No such node %r"%node_tag['node_id'] node = nodes[0] - assert node_tag['node_tag_id'] in node['tag_ids'] + assert node_tag['node_tag_id'] in node['node_tag_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/Nodes.py b/PLC/Nodes.py index 723aeae..99b3ef9 100644 --- a/PLC/Nodes.py +++ b/PLC/Nodes.py @@ -66,7 +66,7 @@ class Node(Row): 'ports': Parameter([int], "List of PCU ports that this node is connected to"), 'peer_id': Parameter(int, "Peer to which this node belongs", nullok = True), 'peer_node_id': Parameter(int, "Foreign node identifier at peer", nullok = True), - 'tag_ids' : Parameter ([int], "List of tags attached to this node"), + 'node_tag_ids' : Parameter ([int], "List of tags attached to this node"), 'nodegroup_ids': Parameter([int], "List of node groups that this node is in"), } related_fields = { diff --git a/planetlab5.sql b/planetlab5.sql index e686ecc..710e436 100644 --- a/planetlab5.sql +++ b/planetlab5.sql @@ -1045,7 +1045,7 @@ FROM peers; -------------------------------------------------------------------------------- CREATE OR REPLACE VIEW node_tags AS SELECT node_id, -array_accum(node_tag_id) AS tag_ids +array_accum(node_tag_id) AS node_tag_ids FROM node_tag GROUP BY node_id; @@ -1103,9 +1103,9 @@ AS ports, COALESCE((SELECT conf_file_ids FROM node_conf_files WHERE node_conf_files.node_id = nodes.node_id), '{}') AS conf_file_ids, -COALESCE((SELECT tag_ids FROM node_tags +COALESCE((SELECT node_tag_ids FROM node_tags WHERE node_tags.node_id = nodes.node_id), '{}') -AS tag_ids, +AS node_tag_ids, node_session.session_id AS session FROM nodes LEFT JOIN peer_node USING (node_id) -- 2.43.0