Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeauchamp committed May 30, 2023
1 parent 7c7d7e7 commit f8c5033
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions @xen-orchestra/backups/_runners/_vmRunners/_AbstractXapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,18 @@ class AbstractXapiVmBackupRunner extends Abstract {
const targetSettings = {
...settings,
...allSettings[remoteId],
healthCheckSr,
}
if (targetSettings.exportRetention !== 0) {
writers.add(new BackupWriter({ backup: this, remoteId, settings: targetSettings }))
writers.add(new BackupWriter({ backup: this, remoteId, settings: targetSettings, healthCheckSr }))
}
})
srs.forEach(sr => {
const targetSettings = {
...settings,
...allSettings[sr.uuid],
healthCheckSr,
}
if (targetSettings.copyRetention !== 0) {
writers.add(new ReplicationWriter({ backup: this, sr, settings: targetSettings }))
writers.add(new ReplicationWriter({ backup: this, sr, settings: targetSettings, healthCheckSr }))
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ exports.IncrementalXapiWriter = class IncrementalXapiWriter extends MixinXapiWri
type: 'SR',
},
})
const hasHealthCheckSr = this._settings.healthCheckSr !== undefined
const hasHealthCheckSr = this._healthCheckSr !== undefined
this.transfer = task.wrapFn(this.transfer)
this.cleanup = task.wrapFn(this.cleanup, !hasHealthCheckSr)
this.healthCheck = task.wrapFn(this.healthCheck, hasHealthCheckSr)
Expand Down
3 changes: 2 additions & 1 deletion @xen-orchestra/backups/_runners/_writers/_AbstractWriter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use strict'

exports.AbstractWriter = class AbstractWriter {
constructor({ backup, settings }) {
constructor({ backup, settings, healthCheckSr }) {
this._backup = backup
this._settings = settings
this._healthCheckSr = healthCheckSr
}

beforeBackup() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ exports.MixinRemoteWriter = (BaseClass = Object) =>
}

healthCheck() {
const sr = this._settings.healthCheckSr
const sr = this._healthCheckSr
assert.notStrictEqual(sr, undefined, 'SR should be defined before making a health check')
assert.notStrictEqual(
this._metadataFileName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports.MixinXapiWriter = (BaseClass = Object) =>
}

healthCheck() {
const sr = this._settings.healthCheckSr
const sr = this._healthCheckSr
assert.notStrictEqual(sr, undefined, 'SR should be defined before making a health check')
assert.notEqual(this._targetVmRef, undefined, 'A vm should have been transfered to be health checked')
// copy VM
Expand Down

0 comments on commit f8c5033

Please sign in to comment.