From: Jan Fajerski Date: Thu, 29 Oct 2020 13:16:56 +0000 (+0100) Subject: snap-schedule: reject invalid retention specs X-Git-Tag: v16.1.0~562^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e9382cc7cac0c33c710b3f5edd1f8e3a66782284;p=ceph.git snap-schedule: reject invalid retention specs Signed-off-by: Jan Fajerski --- diff --git a/src/pybind/mgr/snap_schedule/fs/schedule.py b/src/pybind/mgr/snap_schedule/fs/schedule.py index 225bbf08975..233795fac83 100644 --- a/src/pybind/mgr/snap_schedule/fs/schedule.py +++ b/src/pybind/mgr/snap_schedule/fs/schedule.py @@ -323,6 +323,8 @@ class Schedule(object): if not row: raise ValueError(f'No schedule found for {path}') retention = parse_retention(retention_spec) + if not retention: + raise ValueError(f'Retention spec {retention_spec} is invalid') log.debug(f'db result is {tuple(row)}') current = row['retention'] current_retention = json.loads(current)