]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.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)
committerMer.xuanyi <xuanyi.meng@xtao.tech.com>
Tue, 16 Aug 2022 09:18:13 +0000 (17:18 +0800)
Fixes: https://tracker.ceph.com/issues/57138
Signed-off-by: Mer Xuanyi <xuanyi.meng@xtaotech.com>
src/pybind/mgr/snap_schedule/fs/schedule.py

index d0c9f1098b470a27fe10521b5207ef98b3f6b5c0..afd56fba960b41edb1479ce52f0cd9f4efeedab1 100644 (file)
@@ -296,7 +296,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))