Commit 0854f95d authored by Nicolas Wavrant's avatar Nicolas Wavrant

stack-monitor: monitor.py doesn't always say "failure"

parent 057f060d
...@@ -91,10 +91,14 @@ def runScripts(directory): ...@@ -91,10 +91,14 @@ def runScripts(directory):
def writeFiles(monitors): def writeFiles(monitors):
if len(monitors) == 0: fail = False
message = "SUCCESS : everything is ok\n" for i in monitors.values():
if i != "" :
fail = True
if fail:
message = "FAILURE : something went wrong\n"
else: else:
message ="FAILURE : something went wrong\n" message = "SUCCESS : everything is ok\n"
date = datetime.datetime.now().ctime() date = datetime.datetime.now().ctime()
monitors['datetime'] = date monitors['datetime'] = date
file_bool = os.path.join(monitoring_folder_bool, str(time.time())) file_bool = os.path.join(monitoring_folder_bool, str(time.time()))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment