]> xenbits.xensource.com Git - xenrt-citrix/xenrt.git/commitdiff
Log when there are no clusters to check (commonly due to the site having no remaining...
authorAlex Brett <alex.brett@citrix.com>
Mon, 26 Oct 2015 16:38:17 +0000 (16:38 +0000)
committerAlex Brett <alex.brett@citrix.com>
Mon, 26 Oct 2015 16:38:17 +0000 (16:38 +0000)
server/app/api/schedule.py

index 9850e1f9d844807b2a27980b6dd5b772f8812c10..21005b6a1ab23ff0bd7981281c9f4280fb3bd61f 100755 (executable)
@@ -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()