From 44b8b0cf4a945d22a490e44015cde1dc52e54f35 Mon Sep 17 00:00:00 2001 From: Will Stewart Date: Fri, 24 May 2019 16:51:41 +0100 Subject: [PATCH] checks if healthChecks is a key of app before checking length (#637) (#638) --- marathon_lb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marathon_lb.py b/marathon_lb.py index 9877ad8c..f12a2801 100755 --- a/marathon_lb.py +++ b/marathon_lb.py @@ -1636,7 +1636,7 @@ def get_apps(marathon, apps=[]): old_tasks = sorted(old['tasks'], key=lambda task: task['id']) healthy_new_instances = 0 - if len(app['healthChecks']) > 0: + if 'healthChecks' in app and len(app['healthChecks']) > 0: for task in new['tasks']: if 'healthCheckResults' not in task: continue