- Change .py files to use 4-space indents and no hard tab characters.
[plcapi.git] / PLC / Methods / GetPeerData.py
index 346331a..f26322e 100644 (file)
@@ -1,7 +1,8 @@
 #
 # Thierry Parmentelat - INRIA
-# 
-# $Id: GetPeerData.py 904 2007-10-08 14:28:06Z thierry $
+#
+# $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):
     """
@@ -25,7 +26,7 @@ class GetPeerData(Method):
     database as foreign objects. Also returns the list of foreign
     nodes in this database, for which the calling peer is
     authoritative, to assist in synchronization of slivers.
-    
+
     See the implementation of RefreshPeer for how this data is used.
     """
 
@@ -51,8 +52,8 @@ class GetPeerData(Method):
                              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']] 
-        
+        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'],
@@ -61,16 +62,16 @@ class GetPeerData(Method):
         # XXX Optimize to return only those Persons, Keys, and Slices
         # necessary for slice creation on the calling peer's nodes.
 
-       # filter out special person
-       persons = Persons(self.api, {'~email':[self.api.config.PLC_API_MAINTENANCE_USER,
-                                              self.api.config.PLC_ROOT_USER],
-                                    'peer_id': None}, person_fields)
+        # filter out special person
+        persons = Persons(self.api, {'~email':[self.api.config.PLC_API_MAINTENANCE_USER,
+                                               self.api.config.PLC_ROOT_USER],
+                                     'peer_id': None}, person_fields)
+
+        # filter out system slices
+        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()})
 
-       # filter out system slices
-        system_slice_ids = SliceAttributes(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}),