From: Tony Mack Date: Tue, 27 Feb 2007 18:46:23 +0000 (+0000) Subject: - changed how event_objects are logged. X-Git-Tag: PLCAPI-4.2-0~173 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8b8adc6ce964843b4e178649efcec7cb525d8fec;p=plcapi.git - changed how event_objects are logged. --- diff --git a/PLC/Method.py b/PLC/Method.py index 70b8b214..f671cdeb 100644 --- a/PLC/Method.py +++ b/PLC/Method.py @@ -4,7 +4,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: Method.py,v 1.21 2007/01/16 17:04:08 mlhuang Exp $ +# $Id: Method.py,v 1.22 2007/01/19 17:49:02 tmack Exp $ # import xmlrpclib @@ -139,17 +139,16 @@ class Method: event.sync(commit = False) - if hasattr(self, 'object_ids'): - for object_id in self.object_ids: - event.add_object(object_id, commit = False) + if hasattr(self, 'event_objects') and isinstance(self.event_objects, dict): + for key in self.event_objects.keys(): + for object_id in self.event_objects[key]: + event.add_object(key, object_id, commit = False) + # Set the message for this event if hasattr(self, 'message'): event['message'] = self.message - if hasattr(self, 'object_type'): - event['object_type'] = self.object_type - # Commit event.sync()