]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/snap-schedule: use the right way to check the result returned by fetchone()
authorMer.xuanyi <xuanyi.meng@xtao.tech.com>
Tue, 16 Aug 2022 08:34:26 +0000 (16:34 +0800)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Sun, 10 Sep 2023 08:13:26 +0000 (15:13 +0700)
Fixes: https://tracker.ceph.com/issues/57138
Signed-off-by: Mer Xuanyi <xuanyi.meng@xtaotech.com>
(cherry picked from commit ac5f64e86b53a84bfd649d8f35553aff50803898)

src/pybind/mgr/snap_schedule/fs/schedule.py

index 773a0694af9ae39f1d314070977b4a100ec7f3b8..182d8a28d6851060fed63b913620b62675072967 100644 (file)
@@ -282,7 +282,7 @@ class Schedule(object):
                              (path,))
             row = cur.fetchone()
 
-            if len(row) == 0:
+            if row is None:
                 log.info(f'no schedule for {path} found')
                 raise ValueError('SnapSchedule for {} not found'.format(path))