[pve-devel] [PATCH manager v2 2/7] include a 'status' field for storages

Dominik Csapak d.csapak at proxmox.com
Wed May 3 16:35:16 CEST 2017


by default it is empty,
if we dont have rrd stats, it is 'unknown'

we can use this information for the tree

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

diff --git a/PVE/API2Tools.pm b/PVE/API2Tools.pm
index 78eb4718..1cb494e7 100644
--- a/PVE/API2Tools.pm
+++ b/PVE/API2Tools.pm
@@ -121,6 +121,8 @@ sub extract_storage_stats {
     if (my $d = $rrd->{"pve2-storage/$node/$storeid"}) {
 	$entry->{maxdisk} = ($d->[1] || 0) + 0;
 	$entry->{disk} = ($d->[2] || 0) + 0;
+    } else {
+	$entry->{status} = 'unknown';
     }
 
     return $entry;
-- 
2.11.0





More information about the pve-devel mailing list