Make refresh_pools() behave the same as refresh_images().
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
with self.lock:
if not self.schedules:
+ self.log.debug("MirrorSnapshotScheduleHandler: no schedules")
self.watchers.unregister_all()
self.images = {}
self.queue = {}
self.load_schedules()
+ with self.lock:
+ if not self.schedules:
+ self.log.debug("TrashPurgeScheduleHandler: no schedules")
+ self.pools = {}
+ self.queue = {}
+ self.last_refresh_pools = datetime.now()
+ return
+
pools: Dict[str, Dict[str, str]] = {}
for pool_id, pool_name in get_rbd_pools(self.module).items():