separate get_job and get_jobs in job_api_client

also remove the status parameter, as we never use it anywhere
This commit is contained in:
Leo Hemsted
2016-09-22 09:53:33 +01:00
parent 5bb700ac81
commit 549a17c1f7
6 changed files with 16 additions and 51 deletions

View File

@@ -74,9 +74,7 @@ def statistics_by_state(statistics):
def get_failure_rate_for_job(job):
if not job.get('notifications_delivered'):
if job.get('notifications_failed'):
return 1
return 0
return 1 if job.get('notifications_failed') else 0
return (
job.get('notifications_failed', 0) /
(job.get('notifications_failed', 0) + job.get('notifications_delivered', 0))