Notice: curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value...
[plcapi.git] / PLC / Methods / DeletePCU.py
index 6cee18f..a420403 100644 (file)
@@ -27,14 +27,17 @@ class DeletePCU(Method):
         # Get associated PCU details
         pcus = PCUs(self.api, [pcu_id])
         if not pcus:
-            raise PLCInvalidArgument, "No such PCU"
+            raise PLCInvalidArgument("No such PCU")
         pcu = pcus[0]
 
         if 'admin' not in self.caller['roles']:
             if pcu['site_id'] not in self.caller['site_ids']:
-                raise PLCPermissionDenied, "Not allowed to update that PCU"
+                raise PLCPermissionDenied("Not allowed to update that PCU")
 
         pcu.delete()
-       self.object_ids = [pcu['pcu_id']]
+
+        # Logging variables
+        self.event_objects = {'PCU': [pcu['pcu_id']]}
+        self.message = 'PCU %d deleted' % pcu['pcu_id']
 
         return 1