fix(xo-server#deleteVmBackupNg): pass remote record to getBackupsRemoteAdapter instead of ID (#5624)

Introduced by baa5847949
This commit is contained in:
badrAZ 2021-02-26 12:07:04 +01:00 committed by GitHub
parent 693c07b927
commit 2e5dfa5845
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -921,20 +921,20 @@ export default class BackupNg {
async _listVmBackupsOnRemote(remoteId: string) { async _listVmBackupsOnRemote(remoteId: string) {
const app = this._app const app = this._app
try { try {
const { proxy, url, options } = await app.getRemoteWithCredentials(remoteId) const remote = await app.getRemoteWithCredentials(remoteId)
let backupsByVm let backupsByVm
if (proxy !== undefined) { if (remote.proxy !== undefined) {
;({ [remoteId]: backupsByVm } = await app.callProxyMethod(proxy, 'backup.listVmBackups', { ;({ [remoteId]: backupsByVm } = await app.callProxyMethod(remote.proxy, 'backup.listVmBackups', {
remotes: { remotes: {
[remoteId]: { [remoteId]: {
url, url: remote.url,
options, options: remote.options,
}, },
}, },
})) }))
} else { } else {
backupsByVm = await using(app.getBackupsRemoteAdapter(remoteId), async adapter => backupsByVm = await using(app.getBackupsRemoteAdapter(remote), async adapter =>
formatVmBackups(await adapter.listAllVmBackups()) formatVmBackups(await adapter.listAllVmBackups())
) )
} }