From faaf24655514cb8bffc6c873d3e88539a4e21bfa Mon Sep 17 00:00:00 2001 From: sethho Date: Mon, 27 Jan 2025 13:20:44 -0500 Subject: [PATCH] fixing error that came up when using diff mode with non-default fragments --- src/confcom/azext_confcom/template_util.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/confcom/azext_confcom/template_util.py b/src/confcom/azext_confcom/template_util.py index b7df4572c48..190090920a6 100644 --- a/src/confcom/azext_confcom/template_util.py +++ b/src/confcom/azext_confcom/template_util.py @@ -785,10 +785,13 @@ def readable_diff(diff_dict) -> Dict[str, Any]: # search for the area of the ARM Template with the change i.e. "mounts" or "env_rules" for key in diff_dict[category]: key = str(key) - key_name = re.search(r"'(.*?)'", key).group(1) - human_readable_diff[new_name].setdefault(key_name, []).append( - diff_dict[category][key] - ) + + key_name_group = re.search(r"'(.*?)'", key) + if key_name_group is not None: + key_name = key_name_group.group(1) + human_readable_diff[new_name].setdefault(key_name, []).append( + diff_dict[category][key] + ) return change_key_names(human_readable_diff)