[pbs-devel] [PATCH v3 proxmox-backup 3/3] api: disk list: sort by name

Fabian Ebner f.ebner at proxmox.com
Fri Jul 9 12:32:35 CEST 2021


So callers get more stable results. Most noticeable, the disk list in
the web UI doesn't jump around upon reloading, and while sorting could
be done directly there, like this other callers get the benefit too.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

New in v3.

Does not depend on the other patches.

 src/api2/node/disks/mod.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/api2/node/disks/mod.rs b/src/api2/node/disks/mod.rs
index 44554157..e0c3d39c 100644
--- a/src/api2/node/disks/mod.rs
+++ b/src/api2/node/disks/mod.rs
@@ -66,6 +66,8 @@ pub fn list_disks(
         }
     }
 
+    list.sort_by(|a, b| a.name.cmp(&b.name));
+
     Ok(list)
 }
 
-- 
2.30.2






More information about the pbs-devel mailing list