From: neeraj pratap singh Date: Wed, 26 Jun 2024 16:59:16 +0000 (+0530) Subject: mgr/vol : shortening the name of function X-Git-Tag: v19.2.3~46^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9b62f025aaa71b82bffa9c630a5ed0755f4ace0d;p=ceph.git mgr/vol : shortening the name of function Fixes: https://tracker.ceph.com/issues/66815 Introduced by:https://github.com/ceph/ceph/pull/55838#discussion_r1573655512 Signed-off-by: Neeraj Pratap Singh (cherry picked from commit 6ae002460b8474abe7ebc3592605b88f53253387) --- diff --git a/src/pybind/mgr/volumes/fs/operations/versions/metadata_manager.py b/src/pybind/mgr/volumes/fs/operations/versions/metadata_manager.py index 610a61e6a4c1..146d6d3f453d 100644 --- a/src/pybind/mgr/volumes/fs/operations/versions/metadata_manager.py +++ b/src/pybind/mgr/volumes/fs/operations/versions/metadata_manager.py @@ -172,7 +172,7 @@ class MetadataManager(object): metadata_dict[option] = self.config.get(section,option) return metadata_dict - def list_all_keys_with_specified_values_from_section(self, section, value): + def filter_keys(self, section, value): keys = [] if self.config.has_section(section): options = self.config.options(section) diff --git a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py index fa71660f502a..ec817d7e3d2f 100644 --- a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py +++ b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py @@ -753,7 +753,7 @@ class SubvolumeV1(SubvolumeBase, SubvolumeTemplate): try: if self.has_pending_clones(snapname): - pending_track_id_list = self.metadata_mgr.list_all_keys_with_specified_values_from_section('clone snaps', snapname) + pending_track_id_list = self.metadata_mgr.filter_keys('clone snaps', snapname) else: return pending_clones_info except MetadataMgrException as me: @@ -775,9 +775,9 @@ class SubvolumeV1(SubvolumeBase, SubvolumeTemplate): raise VolumeException(-e.args[0], e.args[1]) else: try: - # If clone is completed between 'list_all_keys_with_specified_values_from_section' - # and readlink(track_id_path) call then readlink will fail with error ENOENT (2) - # Hence we double check whether track_id is exist in .meta file or not. + # If clone is completed between 'filter_keys' and readlink(track_id_path) call + # then readlink will fail with error ENOENT (2). Hence we double check whether + # track_id exists in .meta file or not. # Edge case scenario. # If track_id for clone exist but path /volumes/_index/clone/{track_id} not found # then clone is orphan.