SFA object constructor now requires a argument
[plcapi.git] / PLC / Methods / DeleteSlice.py
index bfb6cd6..d2d4be8 100644 (file)
@@ -1,8 +1,11 @@
+# $Id$
+# $URL$
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
 from PLC.Slices import Slice, Slices
 from PLC.Auth import Auth
+from PLC.SFA import SFA
 
 class DeleteSlice(Method):
     """
@@ -25,7 +28,6 @@ class DeleteSlice(Method):
 
     returns = Parameter(int, '1 if successful')
 
-
     def call(self, auth, slice_id_or_name):
         slices = Slices(self.api, [slice_id_or_name])
         if not slices:
@@ -44,6 +46,9 @@ class DeleteSlice(Method):
                 raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
 
         slice.delete()
-        self.object_ids = [slice['slice_id']]
+        self.event_objects = {'Slice': [slice['slice_id']]}
+
+        sfa = SFA(self.api)
+        sfa.delete_record(slice, 'slice')
 
         return 1