B #1484: Do not nul CPU usage if cloudwatch doesn't return value

(cherry picked from commit 98f6fe5849)
This commit is contained in:
Tino Vazquez committed 2017-12-05 10:06:24 +01:00
1 parent f9aa4aae58
commit 8b18be92e3
1 file changed
+1 -1
+1 -1
View File
@@ -816,7 +816,7 @@ private
if cpu[:datapoints].size != 0
cpu = cpu[:datapoints][-1][:average]
else
cpu = 0
cpu = onevm["MONITORING/CPU"] || 0
end
cpu = cpu.to_f.round(2).to_s
rescue => e