From eaa75b84c8bedd131796eaa12132b0a2d0109501 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 24 Jun 2021 23:53:16 -0600 Subject: [PATCH] lf_check.py : updated paths in report so path does not have to be edited Signed-off-by: Chuck SmileyRekiere --- py-scripts/tools/lf_check.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/py-scripts/tools/lf_check.py b/py-scripts/tools/lf_check.py index 6a5551e8..537c22b6 100755 --- a/py-scripts/tools/lf_check.py +++ b/py-scripts/tools/lf_check.py @@ -35,6 +35,7 @@ TO DO NOTES: 6/14/2021 : 1. add server (telnet localhost 4001) build info, GUI build sha, and Kernel version to the output. 2. add unique database prior to each run +3. note the symbolic link at 192.168.100.201:/var/www/html/html-reports is pointing to /home/lanforge/html-reports ''' import datetime @@ -141,6 +142,8 @@ class lf_check(): report_url = report_url[1:] # following recommendation # NOTE: https://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-from-nic-in-python + # Mail + # command to check if mail running : systemctl status postfix #command = 'echo "$HOSTNAME mail system works!" | mail -s "Test: $HOSTNAME $(date)" chuck.rekiere@candelatech.com' hostname = socket.gethostname() ip = socket.gethostbyname(hostname) @@ -629,16 +632,17 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path. self.logger.info("TIMEOUT FAILURE, Check LANforge Radios") self.test_result = "Time Out" background = self.background_purple - + # stdout_log_link is used for the email reporting to have the corrected path + stdout_log_link = str(stdout_log_txt).replace('/home/lanforge','') + stderr_log_link = str(stderr_log_txt).replace('/home/lanforge','') self.html_results += """ """ + str(test) + """""" + str(command) + """ """ + str(self.test_result) + """ - STDOUT""" + STDOUT""" if self.test_result == "Failure": - self.html_results += """STDERR""" + self.html_results += """STDERR""" elif self.test_result == "Time Out": - self.html_results += """STDERR""" - #self.html_results += """""" + self.html_results += """STDERR""" else: self.html_results += """""" self.html_results += """"""