Merge remote-tracking branch 'origin/pycurl' into planetlab-4_0-branch
[plcapi.git] / PLC / Methods / SliceNodesList.py
index 81cdff4..0c44f66 100644 (file)
@@ -5,10 +5,11 @@ from PLC.Auth import Auth
 from PLC.Slices import Slice, Slices
 from PLC.Nodes import Node, Nodes
 from PLC.Methods.GetSlices import GetSlices
+from PLC.Methods.GetNodes import GetNodes
 
-class SliceNodesList(Method):
+class SliceNodesList(GetSlices, GetNodes):
     """
-    Deprecated. Can be implemented with GetSlices.
+    Deprecated. Can be implemented with GetSlices and GetNodes.
 
     """
   
@@ -25,11 +26,12 @@ class SliceNodesList(Method):
     
 
     def call(self, auth, slice_name):
-       # If we are not admin, make sure to return only viewable
-       # slices.
-       slices = GetSlices(self, auth, [slice_name])
+       slices = GetSlices.call(self, auth, [slice_name])
+       if not slices:
+           return []
+
        slice = slices[0]
-       nodes = Nodes(self.api, slice['node_ids'])
+       nodes = GetNodes.call(self, auth, slice['node_ids'])
        if not nodes:
            return []