fix bug that happen when node is the caller
authorTony Mack <tmack@cs.princeton.edu>
Fri, 11 Jan 2008 18:12:53 +0000 (18:12 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Fri, 11 Jan 2008 18:12:53 +0000 (18:12 +0000)
PLC/Methods/GetNodes.py

index 8e2931a..f4b577d 100644 (file)
@@ -49,9 +49,13 @@ class GetNodes(Method):
            'admin' not in self.caller['roles']:
            slice_ids = set()
            site_ids = set()
+           
            if self.caller:
                slice_ids.update(self.caller['slice_ids'])
-               site_ids.update(self.caller['site_ids'])
+               if isinstance(self.caller, Node):
+                   site_ids.update([self.caller['site_id']])
+               else:  
+                   site_ids.update(self.caller['site_ids'])
 
            # if node has whitelist, only return it if users is at
            # the same site or user has a slice on the whitelist