- Change .py files to use 4-space indents and no hard tab characters.
[plcapi.git] / PLC / Methods / DeletePCU.py
index 4b50a3f..caff26b 100644 (file)
@@ -1,3 +1,5 @@
+# $Id$
+# $URL$
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
@@ -22,9 +24,10 @@ class DeletePCU(Method):
 
     returns = Parameter(int, '1 if successful')
 
+
     def call(self, auth, pcu_id):
         # Get associated PCU details
-        pcus = PCUs(self.api, [pcu_id]).values()
+        pcus = PCUs(self.api, [pcu_id])
         if not pcus:
             raise PLCInvalidArgument, "No such PCU"
         pcu = pcus[0]
@@ -35,4 +38,8 @@ class DeletePCU(Method):
 
         pcu.delete()
 
+        # Logging variables
+        self.event_objects = {'PCU': [pcu['pcu_id']]}
+        self.message = 'PCU %d deleted' % pcu['pcu_id']
+
         return 1