lf_check.py lf_check_config_template.ini : email update , bug fix

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-06-01 17:31:14 -06:00
parent 87b7bcb145
commit 86236b7e77
2 changed files with 9 additions and 9 deletions

View File

@@ -110,16 +110,15 @@ class lf_check():
# Following recommendation
# NOTE: https://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-from-nic-in-python
#command = 'echo "$HOSTNAME mail system works!" | mail -s "Test: $HOSTNAME $(date)" chuck.rekiere@candelatech.com'
if(self.production_run == "TRUE"):
command = 'echo "$HOSTNAME {}/html-report/lf_check_latest.html " | mail -s "Regression Test Results from: $HOSTNAME $(date)" {}'.format(self.host_ip_production,self.email_list_production)
else:
command = 'echo "$HOSTNAME {}/html-report/lf_check_latest.html " | mail -s "Regression Test Results from: $HOSTNAME $(date)" {}'.format(self.host_ip_test,self.email_list_test)
print("running {}".format(command))
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
try:
#out, err = process.communicate()
if(self.production_run == "TRUE"):
command = 'echo "Results from $HOSTNAME {}/html-reports/lf_check_latest.html " | mail -s "Regression Test Results from: $HOSTNAME $(date)" {}'.format(self.host_ip_production,self.email_list_production)
else:
command = 'echo "Results from $HOSTNAME {}/html-reports/lf_check_latest.html " | mail -s "Regression Test Results from: $HOSTNAME $(date)" {}'.format(self.host_ip_test,self.email_list_test)
print("running {}".format(command))
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
# have email on separate timeout
process.wait(timeout=int(self.test_timeout))
except subprocess.TimeoutExpired:
print("send email timed out")