From 23a1a246cc8e9b438c82b489656d39f4147a9343 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Sun, 3 Nov 2013 22:30:51 +0100 Subject: [PATCH] some more debug stuff and set rcpt to _rcpt in json files to not get spammed by mails while testing --- examples/minimal.json | 2 +- examples/stress.json | 2 +- linspector/tasks/mail.py | 3 ++- linspector/tasks/task.py | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/minimal.json b/examples/minimal.json index 07a56cb..0b1063d 100644 --- a/examples/minimal.json +++ b/examples/minimal.json @@ -12,7 +12,7 @@ "root":{ "name": "root", "tasks": [ - { "class":"mail", "type": "foo", "args": { "rcpt": "hanez@linspector.org" }} + { "class":"mail", "type": "foo", "args": { "_rcpt": "hanez@linspector.org" }} ] } }, diff --git a/examples/stress.json b/examples/stress.json index 910ff97..03456c8 100644 --- a/examples/stress.json +++ b/examples/stress.json @@ -12,7 +12,7 @@ "hanez":{ "name": "admin", "tasks": [ - { "class":"mail", "type": "foo", "args": { "rcpt": "hanez@linspector.org" }} + { "class":"mail", "type": "foo", "args": { "_rcpt": "hanez@linspector.org" }} ] } }, diff --git a/linspector/tasks/mail.py b/linspector/tasks/mail.py index 8f3c282..04effbc 100644 --- a/linspector/tasks/mail.py +++ b/linspector/tasks/mail.py @@ -51,7 +51,8 @@ class MailTask(Task): def execute(self, msg, taskArgs): if "rcpt" not in taskArgs: - raise "could not execute Mail Task! No recipient given!" + logger.debug("Could not execute Mail Task! No recipient given!") + raise "Could not execute Mail Task! No recipient given!" logger.debug("Eecuting Task!") diff --git a/linspector/tasks/task.py b/linspector/tasks/task.py index 6e014fc..f8af46e 100644 --- a/linspector/tasks/task.py +++ b/linspector/tasks/task.py @@ -64,6 +64,7 @@ class TaskList(object): logger.debug("Starting Task Execution...") task.execute(msg, taskInfo["args"]) except: + logger.debug("Something failed!") pass def find_task_by_name(self, clazzName):