]> git.proxmox.com Git - pve-manager.git/commitdiff
Fix: #1542, use percent_used key instead of calculation
authorAlwin Antreich <a.antreich@proxmox.com>
Mon, 30 Oct 2017 16:48:52 +0000 (17:48 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 31 Oct 2017 07:21:32 +0000 (08:21 +0100)
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
PVE/API2/Ceph.pm

index 54bad234c7153711abf899e151224a4f7d6051e7..efea30595fc2f7e1b3c6990e842cce7a7eaf99be 100644 (file)
@@ -1493,7 +1493,6 @@ __PACKAGE__->register_method ({
 
        my $stats = {};
        my $res = $rados->mon_command({ prefix => 'df' });
-       my $total = $res->{stats}->{total_avail_bytes} || 0;
 
        foreach my $d (@{$res->{pools}}) {
            next if !$d->{stats};
@@ -1522,8 +1521,7 @@ __PACKAGE__->register_method ({
 
            if (my $s = $stats->{$d->{pool}}) {
                $d->{bytes_used} = $s->{bytes_used};
-               $d->{percent_used} = ($s->{bytes_used} / $total)*100
-                   if $s->{max_avail} && $total;
+               $d->{percent_used} = $s->{percent_used};
            }
            push @$data, $d;
        }