svn keywords
[plcapi.git] / PLC / Methods / GetPeerData.py
index 1dcee31..43a77aa 100644 (file)
@@ -2,6 +2,7 @@
 # Thierry Parmentelat - INRIA
 # 
 # $Id$
+# $URL$
 
 import time
 
@@ -17,7 +18,7 @@ from PLC.Keys import Key, Keys
 from PLC.Nodes import Node, Nodes
 from PLC.Persons import Person, Persons
 from PLC.Slices import Slice, Slices
-from PLC.SliceAttributes import SliceAttributes
+from PLC.SliceTags import SliceTags
 
 class GetPeerData(Method):
     """
@@ -49,6 +50,10 @@ class GetPeerData(Method):
         node_fields = filter(lambda field: field not in \
                              ['boot_nonce', 'key', 'session', 'root_person_ids'],
                              Node.fields)
+        nodes = Nodes(self.api, {'peer_id': None}, node_fields);
+        # filter out whitelisted nodes
+        nodes = [ n for n in nodes if not n['slice_ids_whitelist']] 
+        
 
         person_fields = filter(lambda field: field not in \
                                ['password', 'verification_key', 'verification_expires'],
@@ -63,14 +68,14 @@ class GetPeerData(Method):
                                     'peer_id': None}, person_fields)
 
        # filter out system slices
-        system_slice_ids = SliceAttributes(self.api, {'name': 'system', 'value': '1'}).dict('slice_id')
+        system_slice_ids = SliceTags(self.api, {'name': 'system', 'value': '1'}).dict('slice_id')
        slices = Slices(self.api, {'peer_id': None,
                                   '~slice_id':system_slice_ids.keys()})
        
         result = {
             'Sites': Sites(self.api, {'peer_id': None}),
             'Keys': Keys(self.api, {'peer_id': None}),
-            'Nodes': Nodes(self.api, {'peer_id': None}, node_fields),
+            'Nodes': nodes,
             'Persons': persons,
             'Slices': slices,
             }