fix check_buckets failing if there were no reservations
[raven.git] / apps / gacks / gacksenforce.py
index 80f8472..92364a2 100644 (file)
@@ -95,6 +95,10 @@ class GacksEnforcer:
         all_handles = self.calendar.query_overlap(resource, hasAllocator=name)
         all_handles = all_handles + handles
 
+        if (all_handles == []):
+            # there are no handles, so there's no analysis to do
+            return results
+
         # sort them by start time
         all_handles = sorted(all_handles, key=lambda handle: handle.timeStart)