feat(xo-server-backup-reports): improve the unhealthy VDI chain message (#2640)

Fixes #2639
This commit is contained in:
badrAZ 2018-02-16 15:24:55 +01:00 committed by Pierre Donias
parent 8689b48c55
commit 2b4ae3f1c2

View File

@ -66,8 +66,10 @@ const logError = e => {
console.error('backup report error:', e) console.error('backup report error:', e)
} }
const UNHEALTHY_VDI_CHAIN_ERROR = 'unhealthy VDI chain'
const NO_SUCH_OBJECT_ERROR = 'no such object' const NO_SUCH_OBJECT_ERROR = 'no such object'
const UNHEALTHY_VDI_CHAIN_ERROR = 'unhealthy VDI chain'
const UNHEALTHY_VDI_CHAIN_MESSAGE =
'[(unhealthy VDI chain) Job canceled to protect the VDI chain](https://xen-orchestra.com/docs/backup_troubleshooting.html#vdi-chain-protection)'
const isSkippedError = error => const isSkippedError = error =>
error.message === UNHEALTHY_VDI_CHAIN_ERROR || error.message === UNHEALTHY_VDI_CHAIN_ERROR ||
@ -164,7 +166,15 @@ class BackupReportsXoPlugin {
if (isSkippedError(error)) { if (isSkippedError(error)) {
++nSkipped ++nSkipped
skippedBackupsText.push(...text, `- **Reason**: ${message}`, '') skippedBackupsText.push(
...text,
`- **Reason**: ${
message === UNHEALTHY_VDI_CHAIN_ERROR
? UNHEALTHY_VDI_CHAIN_MESSAGE
: message
}`,
''
)
nagiosText.push( nagiosText.push(
`[(Skipped) ${ `[(Skipped) ${