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
2 changed files with 7 additions and 7 deletions
+2
View File
@@ -24,6 +24,7 @@
- [SDN Controller] Broken encrypted tunnels after host reboot [#4996](https://github.com/vatesfr/xen-orchestra/pull/4996) - [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)) - 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/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 ### Released packages
@@ -42,6 +43,7 @@
> >
> In case of conflict, the highest (lowest in previous list) `$version` wins. > In case of conflict, the highest (lowest in previous list) `$version` wins.
- xo-server-backup-reports patch
- xo-server-perf-alert patch - xo-server-perf-alert patch
- xen-api patch - xen-api patch
- xo-server-auth-ldap minor - xo-server-auth-ldap minor
@@ -667,13 +667,11 @@ class BackupReportsXoPlugin {
}) })
} }
_sendReport({ _sendReport({ mailReceivers, markdown, nagiosMarkdown, subject, success }) {
mailReceivers = this._mailsReceivers, if (mailReceivers === undefined || mailReceivers.length === 0) {
markdown, mailReceivers = this._mailsReceivers
nagiosMarkdown, }
subject,
success,
}) {
const xo = this._xo const xo = this._xo
return Promise.all([ return Promise.all([
xo.sendEmail !== undefined && xo.sendEmail !== undefined &&