From fa071f23f9146d069fd9b3c3ca3d6602a51154b8 Mon Sep 17 00:00:00 2001
From: Eric Pershey <pershey@anl.gov>
Date: Tue, 1 Apr 2025 20:58:27 +0000
Subject: [PATCH] fixing a problem with duplicate keys in a dictionary that
 shouldn't exist.

---
 PBS_Utils/pbs_library.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/PBS_Utils/pbs_library.py b/PBS_Utils/pbs_library.py
index 2ae7d05..138b99b 100644
--- a/PBS_Utils/pbs_library.py
+++ b/PBS_Utils/pbs_library.py
@@ -639,7 +639,12 @@ def process_standard_bstat_head(bstat_head, pbs_ifl):
                 key = attrl.name
                 resource = attrl.resource
                 value = attrl.value
-                if not resource:
+                # fix for max_run server and queue limits, "list"
+                if value.startswith('[') and value.endswith(']'):
+                    if key not in dct:
+                        dct[key] = list()
+                    dct[key].append(value)
+                elif not resource:
                     if key in dct:
                         raise Exception(f"key:{key} is already set and resource didn't exist on the previous loop.")
                     dct[key] = value
-- 
GitLab