From 7b31e92536d8306dd025af38f90bb3c721a35c01 Mon Sep 17 00:00:00 2001 From: Alex Brett Date: Mon, 26 Oct 2015 16:38:17 +0000 Subject: [PATCH] Log when there are no clusters to check (commonly due to the site having no remaining capacity) --- server/app/api/schedule.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/app/api/schedule.py b/server/app/api/schedule.py index 9850e1f9d..21005b6a1 100755 --- a/server/app/api/schedule.py +++ b/server/app/api/schedule.py @@ -470,6 +470,11 @@ class XenRTSchedule(XenRTAPIPage): for cluster in clusters.keys(): clusterprios[cluster] = max([int(m[13]) for m in clusters[cluster].values()]) + # Check if we have any clusters to look at + if len(clusters) == 0: + verbose.write(" no clusters to check (likely no remaining capacity in site)\n") + return False + # Try each cluster # Randomise the list so we spread the load a bit (XRT-737) cs = clusters.keys() -- 2.39.5