From 96b09abe302dd9f7e63ecd180dbe1c66f0651f26 Mon Sep 17 00:00:00 2001
From: Michal Leszczynski <michal.leszczynski@cern.ch>
Date: Thu, 26 Nov 2020 10:36:13 +0100
Subject: [PATCH] Fix confTool --ignoreIrrelevant option

---
 Control/AthenaConfiguration/share/confTool.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/Control/AthenaConfiguration/share/confTool.py b/Control/AthenaConfiguration/share/confTool.py
index 75e501a09179..8c33d8b53b48 100755
--- a/Control/AthenaConfiguration/share/confTool.py
+++ b/Control/AthenaConfiguration/share/confTool.py
@@ -216,8 +216,18 @@ def _loadSingleFile(fname, args):
         ]
 
     if args.ignoreIrrelevant:
+
         def remove_irrelevant(val_dict):
-            return {key:val for key, val in val_dict.items() if key not in args.ignoreList}
+            return (
+                {
+                    key: val
+                    for key, val in val_dict.items()
+                    if key not in args.ignoreList
+                }
+                if isinstance(val_dict, dict)
+                else val_dict
+            )
+
         conf = [
             {key: remove_irrelevant(value) for (key, value) in dic.items()}
             for dic in conf
-- 
GitLab