From 57fe98ddabcccfbb7d4e8e17391317ec254680b4 Mon Sep 17 00:00:00 2001 From: Nathan Bowes Date: Wed, 14 Oct 2020 23:06:50 +0100 Subject: [PATCH] Data Fix for handling new response --- exporter/collectors/test_collector.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exporter/collectors/test_collector.py b/exporter/collectors/test_collector.py index 7247c11..861ccf7 100644 --- a/exporter/collectors/test_collector.py +++ b/exporter/collectors/test_collector.py @@ -11,7 +11,8 @@ def parse_test_response(r, m): t = [] - for i in r.json(): + tests = r.json()['data'] + for i in tests: t.append( { "test_id": str(i['TestID']), @@ -65,7 +66,7 @@ def collect(self): parsed_tests = parse_test_response(tests, m_test_id_flat_list) #Exclude test_ids with active maintenance - test_id_list = [i['TestID'] for i in tests.json() if str(i['TestID']) not in m_test_id_flat_list] + test_id_list = [i['test_id'] for i in parsed_tests if str(i['test_id']) not in m_test_id_flat_list] test_details = [] for i in test_id_list: test_details.append(