From: Tony Mack Date: Thu, 19 Oct 2006 19:32:48 +0000 (+0000) Subject: - fixed how calls with dictionary args are logged X-Git-Tag: pycurl-7_13_1~526 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=cc57f76e1ebedb5d039bee5af483bce0ffa14fe4;p=plcapi.git - fixed how calls with dictionary args are logged --- diff --git a/PLC/Method.py b/PLC/Method.py index 49158930..9b4a4403 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.7 2006/10/18 19:42:46 tmack Exp $ +# $Id: Method.py,v 1.9 2006/10/19 17:02:42 tmack Exp $ # import xmlrpclib @@ -125,7 +125,7 @@ class Method: # Gather necessary logging variables event_type = 'Unknown' object_type = 'Unknown' - person_id = 'Null' + person_id = None object_ids = [] call_name = self.name call_args = ", ".join([unicode(arg) for arg in list(args)[1:]]) @@ -149,9 +149,9 @@ class Method: sql_event = "INSERT INTO events " \ " (person_id, event_type, object_type, fault_code, call, runtime) VALUES" \ - " (%(person_id)s, '%(event_type)s', '%(object_type)s'," \ - " %(fault_code)d, '%(call)s', %(runtime)f)" - self.api.db.do(sql_event % locals()) + " (%(person_id)s, %(event_type)s, %(object_type)s," \ + " %(fault_code)d, %(call)s, %(runtime)f)" + self.api.db.do(sql_event, locals()) # log objects affected for object_id in object_ids: