From 45073182f02f00e6d6c23527e4c9a4f05b4b1cfc Mon Sep 17 00:00:00 2001 From: jitendracandela Date: Thu, 13 Oct 2022 08:25:43 +0530 Subject: [PATCH] Added slash in attach_report_graphs Signed-off-by: jitendracandela --- lf_libs/lf_libs.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lf_libs/lf_libs.py b/lf_libs/lf_libs.py index 1e29818c..de76c9d7 100644 --- a/lf_libs/lf_libs.py +++ b/lf_libs/lf_libs.py @@ -1227,11 +1227,15 @@ class lf_libs: logging.error("Radio name is wrong") def attach_report_graphs(self, report_name=None, pdf_name="WIFI Capacity Test PDF Report"): - relevant_path = "../reports/" + report_name + "/" - logging.info("GETCWD" + str(os.getcwd())) - logging.info("List report dict" + str(os.listdir("../reports"))) - logging.info("CHeck Report directory" + str(os.path.exists(f"../reports/{report_name}"))) - entries = os.listdir("../reports/" + report_name + '/') + if report_name[-1] == "/": + relevant_path = "../reports/" + report_name + entries = os.listdir("../reports/" + report_name) + else: + relevant_path = "../reports/" + report_name + "/" + entries = os.listdir("../reports/" + report_name + '/') + # logging.info("GETCWD" + str(os.getcwd())) + # logging.info("List report dict" + str(os.listdir("../reports"))) + # logging.info("CHeck Report directory" + str(os.path.exists(f"../reports/{report_name}"))) logging.info("Entries" + str(entries)) pdf = False for i in entries: