From: Andreas Teuchert Date: Thu, 7 Jul 2022 12:55:59 +0000 (+0000) Subject: mgr/snap_schedule: Use rados.Ioctx.remove_object() instead of remove(). X-Git-Tag: v18.0.0~521^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=bb958f18af615377852d1579da936ea6c62d6056;p=ceph.git mgr/snap_schedule: Use rados.Ioctx.remove_object() instead of remove(). This fixes the "AttributeError: 'rados.Ioctx' object has no attribute 'remove'" error. Signed-off-by: Andreas Teuchert --- diff --git a/src/pybind/mgr/snap_schedule/fs/schedule_client.py b/src/pybind/mgr/snap_schedule/fs/schedule_client.py index 311f39eb9a3d8..50399d496213b 100644 --- a/src/pybind/mgr/snap_schedule/fs/schedule_client.py +++ b/src/pybind/mgr/snap_schedule/fs/schedule_client.py @@ -201,7 +201,7 @@ class SnapSchedClient(CephfsClient): size, _mtime = ioctx.stat(SNAP_DB_OBJECT_NAME) dump = ioctx.read(SNAP_DB_OBJECT_NAME, size).decode('utf-8') db.executescript(dump) - ioctx.remove(SNAP_DB_OBJECT_NAME) + ioctx.remove_object(SNAP_DB_OBJECT_NAME) except rados.ObjectNotFound: log.debug(f'No legacy schedule DB found in {fs}') db.executescript(Schedule.CREATE_TABLES)