[pve-devel] [PATCH storage] fix #1379: return size as number instead of string

Dominik Csapak d.csapak at proxmox.com
Tue May 16 14:53:54 CEST 2017


this caused the webinterface to sort alphabetically instead of numerical
when sorting by image size

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/Storage/LVMPlugin.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/Storage/LVMPlugin.pm b/PVE/Storage/LVMPlugin.pm
index 60a58e5..a2b3feb 100644
--- a/PVE/Storage/LVMPlugin.pm
+++ b/PVE/Storage/LVMPlugin.pm
@@ -44,7 +44,7 @@ sub lvm_pv_info {
 
 	$pvinfo = {
 	    pvname => $pvname,
-	    size => $size,
+	    size => int($size),
 	    vgname => $vgname,
 	    uuid => $uuid,
 	};
@@ -136,7 +136,7 @@ sub lvm_list_volumes {
 	my $lv_type = substr($lv_attr, 0, 1);
 
 	my $d = {
-	    lv_size => $lv_size,
+	    lv_size => int($lv_size),
 	    lv_type => $lv_type,
 	};
 	$d->{pool_lv} = $pool_lv if $pool_lv;
-- 
2.11.0





More information about the pve-devel mailing list