From d02a2a3aab8c48647c522b53c5edea29649eef29 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Fri, 22 May 2015 20:12:57 +0200 Subject: [PATCH 1/2] little change boswatch, plugin_test includes ready --- boswatch.py | 2 +- plugin_test.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boswatch.py b/boswatch.py index e94a597..678e37f 100755 --- a/boswatch.py +++ b/boswatch.py @@ -127,7 +127,7 @@ try: for key,val in globals.config.items("BOSWatch"): logging.debug(" - %s = %s", key, val) except: - logging.debug("cannot read config file") + logging.exception("cannot read config file") else: #load plugins diff --git a/plugin_test.py b/plugin_test.py index cda6ed4..49c6308 100644 --- a/plugin_test.py +++ b/plugin_test.py @@ -5,15 +5,15 @@ # Use this as a simple Plugin Loading Tool to test your own Coded Plugins # ########################################################################### -import globals # Global variables -import pluginloader - import logging import ConfigParser #for parse the config file import os #for log mkdir import time #timestamp for doublealarm +from includes import globals # Global variables +from includes import pluginloader + #create new logger logger = logging.getLogger() logger.setLevel(logging.DEBUG) @@ -46,7 +46,7 @@ try: for key,val in globals.config.items("Plugins"): logging.debug(" - %s = %s", key, val) except: - logging.debug("cannot read config file") + logging.exception("cannot read config file") try: @@ -86,4 +86,4 @@ while True: exit() except: logging.exception("unknown error") - exit() \ No newline at end of file + exit() From da2ea5fe4ea844d8a4ffe1a0f94c5ad7a9499efb Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Fri, 22 May 2015 20:17:57 +0200 Subject: [PATCH 2/2] change in httpreq plugin --- plugins/httpRequest/httpRequest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/httpRequest/httpRequest.py b/plugins/httpRequest/httpRequest.py index c0614c7..0720db7 100644 --- a/plugins/httpRequest/httpRequest.py +++ b/plugins/httpRequest/httpRequest.py @@ -66,6 +66,10 @@ def run(typ,freq,data): logging.exception("no HTTP request been sended") except: #otherwise logging.exception("cannot get HTTP response") + + finally: + logging.debug("close http-Connection") + httprequest.close() ########## User Plugin CODE ########## except: