From e8dce098ec54b157a71aaa8dc1c2954120143190 Mon Sep 17 00:00:00 2001 From: Gogs Date: Tue, 5 Sep 2017 05:24:59 +0000 Subject: [PATCH] CO - bug fix folders actor --- src/utils/agents/actor.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/utils/agents/actor.py b/src/utils/agents/actor.py index d53cffe..9942169 100644 --- a/src/utils/agents/actor.py +++ b/src/utils/agents/actor.py @@ -15,7 +15,7 @@ from threading import Thread import os import shutil import subprocess - +import re from monitor import ProcessCounter from utils.transport import QueueListener, QueueWriter, QueueReader from utils.params import PARAMS @@ -37,7 +37,7 @@ class Actor(): o = eval("".join([name,"()"])) o.init(args) except Exception,e: - print e + print str(e) return o def __init__(self): """ @@ -55,8 +55,6 @@ class Actor(): def init(self,args): self.config = args - def process(self,item): - pass def isValid(self,item): return False @@ -153,7 +151,7 @@ class Mailer (Actor): # If not authenticated the preconditions have failed # except Exception,e: - print e + print str(e) self.handler = None pass @@ -184,8 +182,8 @@ class Folders(Actor): @params threshold in terms of size, or age. It will be applied to all folders """ - def init(self,**args): - Actor.init(self) + def init(self,args): + Actor.init(self,args) #self.lfolders = args['folders'] #config['folders'] #self.action = args['action'] #{clear,archive} config['actions']['folders'] self.threshold = self.get_size( args['threshold']) #self.config['threshold']) @@ -228,7 +226,7 @@ class Folders(Actor): converts size values into MB and returns the value without units """ units = {'MB':1000,'GB':1000000,'TB':1000000000} # converting to kb - key = set(unites) & set(re.split('(\d+)',value.upper())) + key = set(units) & set(re.split('(\d+)',value.upper())) if len(key) == 0: return -1 key = key.pop()