git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8b8adc6
)
- replace Event.object_type with Event.object_types (a list which corresponds to...
author
Tony Mack
<tmack@cs.princeton.edu>
Tue, 27 Feb 2007 18:52:14 +0000
(18:52 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Tue, 27 Feb 2007 18:52:14 +0000
(18:52 +0000)
PLC/Events.py
patch
|
blob
|
history
diff --git
a/PLC/Events.py
b/PLC/Events.py
index
e87cbbe
..
836e8fb
100644
(file)
--- a/
PLC/Events.py
+++ b/
PLC/Events.py
@@
-4,7
+4,7
@@
# Tony Mack <tmack@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
# Tony Mack <tmack@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: Events.py,v 1.1
0 2006/12/20 14:07:22
tmack Exp $
+# $Id: Events.py,v 1.1
1 2007/01/19 17:50:46
tmack Exp $
#
from PLC.Faults import *
#
from PLC.Faults import *
@@
-28,13
+28,13
@@
class Event(Row):
'call_name': Parameter(str, "Call responsible for this event"),
'call': Parameter(str, "Call responsible for this event, including paramters"),
'message': Parameter(str, "High level description of this event"),
'call_name': Parameter(str, "Call responsible for this event"),
'call': Parameter(str, "Call responsible for this event, including paramters"),
'message': Parameter(str, "High level description of this event"),
- 'object_type': Parameter(str, "What type of object is this event affecting"),
'runtime': Parameter(float, "Runtime of event"),
'time': Parameter(int, "Date and time that the event took place, in seconds since UNIX epoch", ro = True),
'runtime': Parameter(float, "Runtime of event"),
'time': Parameter(int, "Date and time that the event took place, in seconds since UNIX epoch", ro = True),
- 'object_ids': Parameter([int], "IDs of objects affected by this event")
+ 'object_ids': Parameter([int], "IDs of objects affected by this event"),
+ 'object_types': Parameter([str], "What type of object were affected by this event")
}
}
- def add_object(self, object_id, commit = True):
+ def add_object(self, object_
type, object_
id, commit = True):
"""
Relate object to this event.
"""
"""
Relate object to this event.
"""
@@
-47,8
+47,8
@@
class Event(Row):
self['object_ids'] = []
if object_id not in self['object_ids']:
self['object_ids'] = []
if object_id not in self['object_ids']:
- self.api.db.do("INSERT INTO event_object (event_id, object_id)" \
- " VALUES(%(event_id)d, %(object_id)d)",
+ self.api.db.do("INSERT INTO event_object (event_id, object_id
, object_type
)" \
+ " VALUES(%(event_id)d, %(object_id)d
, %(object_type)s
)",
locals())
if commit:
locals())
if commit: