Include timestamp into the message generated by the kernel

This commit is contained in:
Gerard Wagener 2010-01-18 21:52:20 +01:00
parent 48764f8eb8
commit a515f03904

View file

@ -1,7 +1,6 @@
#Common functions shared between aha and aha-worker #Common functions shared between aha and aha-worker
#FIXME Memory leak in process trees -> need to clean up them #FIXME Memory leak in process trees -> need to clean up them
#triggered by the kernel #triggered by the kernel
#TODO loader should include timestamp in the message hash
from ctypes import * from ctypes import *
import os,sys,random,datetime,json,time, unittest import os,sys,random,datetime,json,time, unittest
@ -14,6 +13,9 @@ class AHAActions:
#Can trow IOError #Can trow IOError
def load_file(self,filename): def load_file(self,filename):
msg = {} msg = {}
s = os.stat(filename)
ts = int(s[os.path.stat.ST_CTIME])
msg['timestamp'] = ts
fp = open(filename,'r') fp = open(filename,'r')
for i in fp.read().split('\n'): for i in fp.read().split('\n'):
try: try: