]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/vol: improvements and cleanup for "list_volumes()"
authorRishabh Dave <ridave@redhat.com>
Wed, 14 Feb 2024 10:01:17 +0000 (15:31 +0530)
committerRishabh Dave <ridave@redhat.com>
Tue, 6 Aug 2024 10:30:23 +0000 (16:00 +0530)
commit9f355b681b3d5ff5a5b2c9b2b8aea117100089c9
tree6937ce0a72f9a2170d6b9778575ddf5c6f633350
parent8c536f78907fe1d42e1df612604d5872019b501d
mgr/vol: improvements and cleanup for "list_volumes()"

List volumes returns a list of of 1-member dictionaries where each
member is "{'name': <volname>}". This format is useful printing output
of the command "ceph fs volume ls" but for internal use this format is
hinderance since before using it, this list needs to be resolved  from
list of dictionaries to list of strings.

Return a list of strings and move the code for converting it to list of
dictionaries to method "list_fs_volumes()" (which is method run by "ceph
fs volume ls" command).

This triggers change in async_job.py where we need volnames. The code
here converts list of dicts to list of string. This needs to removed.

Second, don't create unnecessary temporary variable "fs_map" in
"list_volumes()" since it is not required. To get fs names we can
directly iterate.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/pybind/mgr/volumes/fs/async_job.py
src/pybind/mgr/volumes/fs/operations/volume.py
src/pybind/mgr/volumes/fs/volume.py