CO - Bug fix on assignment and missing values

community
Gogs 7 years ago
parent cf843c16bd
commit dabf772217

@ -253,13 +253,13 @@ def InitCollector():
# @TODO : Validate the account & plan, insure preconditions are met/satisfied
#
m = {'apps':'monitor.DetailProcess','folders':'monitor.FileWatch'}
a = {'apps':'Apps','mailer':'Mailer','folders':'Folder'}
a = {'apps':'actor.Apps','mailer':'actor.Mailer','folders':'actor.Folder'}
lagents = []
lactors = []
for id in m :
if id in body :
agent = eval(m[id]+"()")
actor = eval(m[id]+"()")
actor = eval(a[id]+"()")
args = body[id] if id in body else None
if args is not None :
agent.init(args)
@ -277,7 +277,7 @@ def InitCollector():
config['store']['args']['dbname'] = None #'monitor-logs'
config['store']['args']['uid'] = key
manager = Manager()
manager.init(actors = actors,agents=lagents,config=config,key=key,node=node) ;
manager.init(actors = lactors,agents=lagents,config=config,key=key,node=node) ;
r = [pickle.dumps(manager)]
except Exception,e:
print '***** ',e

@ -55,7 +55,11 @@ class Manager() :
self.DELAY = -1
self.LIMIT = -1
def filter(meta) :
self.filter(meta)
if len(self.actors) > 0 :
self.setup(meta)
def filter(self,meta) :
scope = []
lactors= []
for item in meta :
@ -63,7 +67,10 @@ class Manager() :
if 'actors' in item :
lactors= lactors + item['actors'].split(',')
self.agents = [agent for agent in self.agents if agent.getName() in scope]
self.actors = [ actor for actor in self.actors if actor.getName() in lactors]
if len(lactors) == 0 :
self.actors = []
self.actors = [ actor for actor in self.actors if actor.geIdentifier() in lactors]
if len(self.actors) > 0 :
#
# We should configure the actors accordingly and make sure they are operational
@ -175,9 +182,11 @@ class Manager() :
#
#
if agent.reboot(row) :
#
self.post(row)
index = self.agents.index(agent)
if len(self.actors) > index and self.actors[index].getIdentifier() == agent.getName() :
actor = self.actors[index]
print self.analyze(row)
self.lock.acquire()
store = self.factory.instance(type=write_class,args=read_args)
store.flush(size=self.LIMIT)

Loading…
Cancel
Save