+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
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.
"""
accepts = [
Auth(),
- Slice.fields['slice_name']
+ Slice.fields['name']
]
returns = [Node.fields['hostname']]
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 []