Commit 42d7e5ca authored by Alain Takoudjou's avatar Alain Takoudjou

promise: do not try to read json file when it's not created yet

parent 50707d9e
......@@ -42,6 +42,8 @@ def checkApachedexResult(apachedex_path, apachedex_report_status_file, desired_t
message = "No result found in the apdex file or the file is corrupted"
break
if not os.path.exists(apachedex_report_status_file):
return 0, "ApacheDex didn't run yet!"
with open(apachedex_report_status_file) as f:
try:
json_content = json.load(f)
......
......@@ -53,6 +53,8 @@ def checkMariadbDigestResult(mariadbdex_path, mariadbdex_report_status_file,
message = "No result found in the slow query digest file or the file is corrupted"
break
if not os.path.exists(mariadbdex_report_status_file):
return 0, "No slow query result yet!"
with open(mariadbdex_report_status_file) as f:
try:
json_content = json.load(f)
......
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