fix(xo-server-backup-reports): dont bail on successful VM with reportWhen failure (#3185)
Fixes #3181
This commit is contained in:
@@ -6,8 +6,11 @@
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- [Backup Reports] Report not sent if reportWhen failure and at least a VM is successfull [#3181](https://github.com/vatesfr/xen-orchestra/issues/3181) (PR [#3185](https://github.com/vatesfr/xen-orchestra/pull/3185))
|
||||
|
||||
### Released packages
|
||||
|
||||
- xo-server-backup-reports v0.12.3
|
||||
- xo-server v5.23.0
|
||||
- xo-web v5.23.0
|
||||
|
||||
|
||||
@@ -187,10 +187,9 @@ class BackupReportsXoPlugin {
|
||||
let nFailures = 0
|
||||
let nSkipped = 0
|
||||
let nInterrupted = 0
|
||||
let nSuccesses = 0
|
||||
for (const taskLog of log.tasks) {
|
||||
if (taskLog.status === 'success' && reportWhen === 'failure') {
|
||||
return
|
||||
continue
|
||||
}
|
||||
|
||||
const vmId = taskLog.data.id
|
||||
@@ -361,13 +360,13 @@ class BackupReportsXoPlugin {
|
||||
`[(Interrupted) ${vm !== undefined ? vm.name_label : 'undefined'}]`
|
||||
)
|
||||
} else {
|
||||
++nSuccesses
|
||||
successfulVmsText.push(...text, '', '', ...subText, '')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const nVms = log.tasks.length
|
||||
const nSuccesses = nVms - nFailures - nSkipped - nInterrupted
|
||||
let markdown = [
|
||||
`## Global status: ${log.status}`,
|
||||
'',
|
||||
|
||||
Reference in New Issue
Block a user