get rid of svn keywords once and for good
[plcapi.git] / PLC / Methods / SliceListUserSlices.py
index 86f9778..1635905 100644 (file)
@@ -4,10 +4,12 @@ from PLC.Filter import Filter
 from PLC.Auth import Auth
 from PLC.Slices import Slice, Slices
 from PLC.Persons import Person, Persons
+from PLC.Methods.GetSlices import GetSlices
+from PLC.Methods.GetPersons import GetPersons
 
-class SliceListUserSlices(Method):
+class SliceListUserSlices(GetSlices, GetPersons):
     """
-    Deprecated. Can be implemented with GetPersons.
+    Deprecated. Can be implemented with GetPersons and GetSlices.
 
     Return the slices the specified user (by email address) is a member of.
 
@@ -17,26 +19,29 @@ class SliceListUserSlices(Method):
     slice_filter, details about that slice will not be returned.
     """
 
+    status = "deprecated"
+
     roles = ['admin', 'pi', 'user']
 
     accepts = [
         Auth(),
-        Parameter(str, "Slice prefix", nullok = True)
+        Person.fields['email']
         ]
 
-    returns = [Slice.fields]
-    
+    returns = [Slice.fields['name']]
+
 
     def call(self, auth, email):
 
-       persons = Persons(self.api, [email])
-       if not persons:
-               return []
-       person = persons[0]
-       slice_ids = person['slice_ids']
-       if not slice_ids:
-               return []
-       slices = Slices(self.api, slice_ids)
-       slice_names = [slice['name'] for slice in slices]
+        persons = GetPersons.call(self, auth, [email])
+        if not persons:
+            return []
+        person = persons[0]
+        slice_ids = person['slice_ids']
+        if not slice_ids:
+            return []
+
+        slices = GetSlices.call(self, auth, slice_ids)
+        slice_names = [slice['name'] for slice in slices]
 
         return slice_names