git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
take out the code that computes a new key - for use by the dummynet boot medium creat...
[plcapi.git]
/
PLC
/
Methods
/
SliceNodesList.py
diff --git
a/PLC/Methods/SliceNodesList.py
b/PLC/Methods/SliceNodesList.py
index
556cb17
..
0c44f66
100644
(file)
--- a/
PLC/Methods/SliceNodesList.py
+++ b/
PLC/Methods/SliceNodesList.py
@@
-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.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
.
"""
"""
@@
-18,18
+19,19
@@
class SliceNodesList(Method):
accepts = [
Auth(),
accepts = [
Auth(),
- Slice.fields['
slice_
name']
+ Slice.fields['name']
]
returns = [Node.fields['hostname']]
def call(self, auth, slice_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]
slice = slices[0]
- nodes =
Nodes(self.api
, slice['node_ids'])
+ nodes =
GetNodes.call(self, auth
, slice['node_ids'])
if not nodes:
return []
if not nodes:
return []