Yaniv Dary has uploaded a new change for review.

Change subject: reports: fixed system dashboard error on a clean system
......................................................................

reports: fixed system dashboard error on a clean system

Change-Id: I163b113a232470708fcdbbc92483b83fde547b6b
Bug-Url: https://bugzilla.redhat.com/1073340
Signed-off-by: Yaniv Dary <[email protected]>
---
M 
packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_storage_space_status_dr7_jrxml.data
1 file changed, 14 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/05/28005/1

diff --git 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_storage_space_status_dr7_jrxml.data
 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_storage_space_status_dr7_jrxml.data
index 86cf350..e4fe90b 100644
--- 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_storage_space_status_dr7_jrxml.data
+++ 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_storage_space_status_dr7_jrxml.data
@@ -11,16 +11,22 @@
 -- out of the total storage domains disks space
 
 SELECT
-    (
-        SUM (
-            cast ( available_disk_size_gb as float )
-        ) /
-        SUM (
+    CASE 
+        WHEN SUM (
             cast ( used_disk_size_gb as float ) +
             cast ( available_disk_size_gb as float )
-        )
-    ) * 100
-    AS free_disk_size_gb_percent
+        ) != 0 
+            THEN (
+                SUM (
+                    cast ( available_disk_size_gb as float )
+                ) /
+                SUM (
+                    cast ( used_disk_size_gb as float ) +
+                    cast ( available_disk_size_gb as float )
+                )
+            ) * 100 
+        ELSE NULL
+    END AS free_disk_size_gb_percent
 FROM storage_domain_samples_history
 WHERE
     -- Here we get the latest storage domains configuration


-- 
To view, visit http://gerrit.ovirt.org/28005
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I163b113a232470708fcdbbc92483b83fde547b6b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-reports
Gerrit-Branch: master
Gerrit-Owner: Yaniv Dary <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to