cleanup - make node/interface/slice similar
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 11 Dec 2008 07:54:15 +0000 (07:54 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 11 Dec 2008 07:54:15 +0000 (07:54 +0000)
PLC/Methods/DeleteNodeTag.py
PLC/Methods/UpdateNodeTag.py
PLC/Nodes.py
planetlab5.sql

index 75de911..97140e9 100644 (file)
@@ -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']:
index 16123c6..cb7a6a5 100644 (file)
@@ -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']:
index 723aeae..99b3ef9 100644 (file)
@@ -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 = {
index e686ecc..710e436 100644 (file)
@@ -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)