Skip to content

Commit

Permalink
Merge pull request #148 from nathan-weinberg/bug-fix
Browse files Browse the repository at this point in the history
Fixed ZeroDivisionError bug
  • Loading branch information
nathan-weinberg authored Jul 30, 2020
2 parents a89e7e8 + 157de79 commit e1707c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions remind.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import jinja2
from smtplib import SMTP
from email.mime.text import MIMEText

from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from smtplib import SMTP
from functions import generate_html_file, get_osp_version, \
get_jenkins_job_info, get_bugs_dict, get_jira_dict, \
get_other_blockers
Expand Down
7 changes: 6 additions & 1 deletion report.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,16 @@ def run_report(config, blockers, server, header, test_email, no_email):
# sort rows by descending OSP version
rows = sorted(rows, key=lambda row: row['osp_version'], reverse=True)

# log and exit if no rows built - otherwise program will crash on summary generation
num_jobs = len(rows)
if num_jobs == 0:
print("No rows could be built with data for any of the jobs found with given search field. Exiting...")
return None

# initialize summary
summary = {}

# job result metrics
num_jobs = len(rows)
summary['total_success'] = "Total SUCCESS: {}/{} = {}%".format(num_success, num_jobs, percent(num_success, num_jobs))
summary['total_unstable'] = "Total UNSTABLE: {}/{} = {}%".format(num_unstable, num_jobs, percent(num_unstable, num_jobs))
summary['total_failure'] = "Total FAILURE: {}/{} = {}%".format(num_failure, num_jobs, percent(num_failure, num_jobs))
Expand Down

0 comments on commit e1707c1

Please sign in to comment.