]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/snap-schedule: cleanup code 47624/head
authorMer.xuanyi <xuanyi.meng@xtao.tech.com>
Tue, 16 Aug 2022 09:20:45 +0000 (17:20 +0800)
committerMer.xuanyi <xuanyi.meng@xtao.tech.com>
Tue, 16 Aug 2022 09:20:45 +0000 (17:20 +0800)
Signed-off-by: Mer Xuanyi <xuanyi.meng@xtaotech.com>
src/pybind/mgr/snap_schedule/fs/schedule.py

index afd56fba960b41edb1479ce52f0cd9f4efeedab1..95e43b7e0ecd51a70982e5fef5ed259da1ccd7c2 100644 (file)
@@ -345,7 +345,7 @@ class Schedule(object):
                       retention_spec: str) -> None:
         with db:
             row = db.execute(cls.GET_RETENTION, (path,)).fetchone()
-            if not row:
+            if row is None:
                 raise ValueError(f'No schedule found for {path}')
             retention = parse_retention(retention_spec)
             if not retention:
@@ -369,7 +369,7 @@ class Schedule(object):
                      retention_spec: str) -> None:
         with db:
             row = db.execute(cls.GET_RETENTION, (path,)).fetchone()
-            if not row:
+            if row is None:
                 raise ValueError(f'No schedule found for {path}')
             retention = parse_retention(retention_spec)
             current = row['retention']