mirror of
https://github.com/ansible/awx.git
synced 2026-03-21 19:07:39 -02:30
fix get failures count logic
This commit is contained in:
@@ -18,19 +18,11 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
|
|||||||
// and their status data
|
// and their status data
|
||||||
Object.keys(event_data).forEach(key => {
|
Object.keys(event_data).forEach(key => {
|
||||||
// failed passes boolean not integer
|
// failed passes boolean not integer
|
||||||
if (key === "failed") {
|
if (key === "changed" ||
|
||||||
// array of hosts from failed type
|
key === "dark" ||
|
||||||
hostsArr = Object.keys(event_data[key]);
|
key === "failures" ||
|
||||||
hostsArr.forEach(host => {
|
key === "ok" ||
|
||||||
if (!hosts[host]) {
|
key === "skipped") {
|
||||||
// host has not been added to hosts object
|
|
||||||
// add now
|
|
||||||
hosts[host] = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
hosts[host][key] = event_data[key][host];
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// array of hosts from each type ("changed", "dark", etc.)
|
// array of hosts from each type ("changed", "dark", etc.)
|
||||||
hostsArr = Object.keys(event_data[key]);
|
hostsArr = Object.keys(event_data[key]);
|
||||||
hostsArr.forEach(host => {
|
hostsArr.forEach(host => {
|
||||||
@@ -61,7 +53,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
|
|||||||
return o.dark > 0;
|
return o.dark > 0;
|
||||||
}),
|
}),
|
||||||
failures : _.filter(hosts, function(o){
|
failures : _.filter(hosts, function(o){
|
||||||
return o.failed === true;
|
return o.failures > 0;
|
||||||
}),
|
}),
|
||||||
changed : _.filter(hosts, function(o){
|
changed : _.filter(hosts, function(o){
|
||||||
return o.changed > 0;
|
return o.changed > 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user