aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticon-report-email-web.lua
diff options
context:
space:
mode:
authoronefang2019-12-09 09:23:51 +1000
committeronefang2019-12-09 09:23:51 +1000
commitf3077e2a4bdac60a829ddaee4061f20ccf2019dc (patch)
tree9045f7e8232493e15208358dc321ae9ff29952ce /apt-panopticon-report-email-web.lua
parentMore things to ignore. (diff)
downloadapt-panopticon-f3077e2a4bdac60a829ddaee4061f20ccf2019dc.zip
apt-panopticon-f3077e2a4bdac60a829ddaee4061f20ccf2019dc.tar.gz
apt-panopticon-f3077e2a4bdac60a829ddaee4061f20ccf2019dc.tar.bz2
apt-panopticon-f3077e2a4bdac60a829ddaee4061f20ccf2019dc.tar.xz
Clean up the counting of errors and warnings.
Diffstat (limited to 'apt-panopticon-report-email-web.lua')
-rwxr-xr-xapt-panopticon-report-email-web.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua
index 36e1ca6..1144550 100755
--- a/apt-panopticon-report-email-web.lua
+++ b/apt-panopticon-report-email-web.lua
@@ -174,14 +174,12 @@ local status = function(host, results, typ)
174 if nil ~= results[typ] then 174 if nil ~= results[typ] then
175 e = results[typ].errors 175 e = results[typ].errors
176 w = results[typ].warnings 176 w = results[typ].warnings
177--[[
178 for k, v in pairs(results[typ]) do 177 for k, v in pairs(results[typ]) do
179 if "table" == type(v) then 178 if "table" == type(v) then
180 if 0 <= v.errors then e = e + v.errors else to = true end 179 if 0 <= v.errors then e = e + v.errors else to = true end
181 if 0 <= v.warnings then w = w + v.warnings else to = true end 180 if 0 <= v.warnings then w = w + v.warnings else to = true end
182 end 181 end
183 end 182 end
184]]
185 else 183 else
186 for k, v in pairs(results) do 184 for k, v in pairs(results) do
187 if "table" == type(v) then 185 if "table" == type(v) then
@@ -251,9 +249,9 @@ local collate = function(host, ip, results)
251 for i, u in pairs(v) do 249 for i, u in pairs(v) do
252 if "table" == type(u) then 250 if "table" == type(u) then
253 for h, t in pairs(u) do 251 for h, t in pairs(u) do
254 local a = results[k][h] 252 local a = results[k][i][h]
255 if nil == a then a = 0 end 253 if nil == a then a = 0 end
256 results[k][h] = a + t 254 results[k][i][h] = a + t
257 end 255 end
258 else 256 else
259 local a = results[k][i] 257 local a = results[k][i]