fix(xo-server-backup-reports): fix No recipients defined error (#4998)

Correctly fall back to plugin recipients if `mailRecipients` is empty.
This commit is contained in:
badrAZ 2020-05-19 14:22:24 +02:00 committed by GitHub
parent 6cf211a9ad
commit d649211330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -24,6 +24,7 @@
- [SDN Controller] Broken encrypted tunnels after host reboot [#4996](https://github.com/vatesfr/xen-orchestra/pull/4996)
- Don't log server's credentials in case of `SESSION_AUTHENTICATION_FAILED` error (PR [#4995](https://github.com/vatesfr/xen-orchestra/pull/4995))
- [Plugin/perf-alert] Fix compatibility of the alert messages with XenCenter (PR [#5004](https://github.com/vatesfr/xen-orchestra/pull/5004))
- [Plugin/backup-reports] Fix `No recipients defined` error when recipients defined at plugin level (PR [#4998](https://github.com/vatesfr/xen-orchestra/pull/4998))
### Released packages
@ -42,6 +43,7 @@
>
> In case of conflict, the highest (lowest in previous list) `$version` wins.
- xo-server-backup-reports patch
- xo-server-perf-alert patch
- xen-api patch
- xo-server-auth-ldap minor

View File

@ -667,13 +667,11 @@ class BackupReportsXoPlugin {
})
}
_sendReport({
mailReceivers = this._mailsReceivers,
markdown,
nagiosMarkdown,
subject,
success,
}) {
_sendReport({ mailReceivers, markdown, nagiosMarkdown, subject, success }) {
if (mailReceivers === undefined || mailReceivers.length === 0) {
mailReceivers = this._mailsReceivers
}
const xo = this._xo
return Promise.all([
xo.sendEmail !== undefined &&