]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/snap_schedule: fix message format error
authorMilind Changire <mchangir@redhat.com>
Tue, 16 Jan 2024 12:17:53 +0000 (17:47 +0530)
committerMilind Changire <mchangir@redhat.com>
Mon, 12 Aug 2024 03:29:10 +0000 (08:59 +0530)
Fixes: https://tracker.ceph.com/issues/64042
Signed-off-by: Milind Changire <mchangir@redhat.com>
src/pybind/mgr/snap_schedule/fs/schedule.py

index 5a8bee2bbb1b194059b00dae7c5d29716c4be18f..742e778c563297fb40a57cf04749486dcfcd2754 100644 (file)
@@ -364,9 +364,9 @@ class Schedule(object):
             current_retention = json.loads(current)
             for r, v in retention.items():
                 if r in current_retention:
-                    msg = (f'Retention for {r} is already present with value'
-                           f'{current_retention[r]}. Please remove first')
-                    raise ValueError(msg)
+                    msg = (f'Retention for {r} is already present with value '
+                           f'{current_retention[r]}. Please remove it first.')
+                    raise FileExistsError(msg)
             current_retention.update(retention)
             db.execute(cls.UPDATE_RETENTION,
                        (json.dumps(current_retention), path))