From 39de8631f27472aa663ff29045c51361ff833932 Mon Sep 17 00:00:00 2001 From: SSpalding <57235700+AMZN-scspaldi@users.noreply.github.com> Date: Tue, 18 May 2021 11:13:59 -0700 Subject: [PATCH] Caught KeyError and changed to log message. (#782) Fixed missing key breaking report combining. --- scripts/ctest/result_processing/result_processing.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/ctest/result_processing/result_processing.py b/scripts/ctest/result_processing/result_processing.py index 791b15fece..e8ba78265c 100755 --- a/scripts/ctest/result_processing/result_processing.py +++ b/scripts/ctest/result_processing/result_processing.py @@ -118,8 +118,10 @@ def _merge_xml_results(xml_results_path, prefix, merged_xml_name, parent_element def _aggregate_attributes(nodes): for node in nodes: for attribute in attributes_to_aggregate: - value = node.attrib[attribute.name] - temp_dict[attribute.name] += attribute.func(value) + if attribute.name in node.attrib: + temp_dict[attribute.name] += attribute.func(node.attrib[attribute.name]) + else: + print("Failed to find key {} in {}, continuing...".format(attribute.name, node.tag)) base_tree = xet.parse(xml_files[0]) base_tree_root = base_tree.getroot()