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) {
const app = this._app
try {
const { proxy, url, options } = await app.getRemoteWithCredentials(remoteId)
const remote = await app.getRemoteWithCredentials(remoteId)
let backupsByVm
if (proxy !== undefined) {
;({ [remoteId]: backupsByVm } = await app.callProxyMethod(proxy, 'backup.listVmBackups', {
if (remote.proxy !== undefined) {
;({ [remoteId]: backupsByVm } = await app.callProxyMethod(remote.proxy, 'backup.listVmBackups', {
remotes: {
[remoteId]: {
url,
options,
url: remote.url,
options: remote.options,
},
},
}))
} else {
backupsByVm = await using(app.getBackupsRemoteAdapter(remoteId), async adapter =>
backupsByVm = await using(app.getBackupsRemoteAdapter(remote), async adapter =>
formatVmBackups(await adapter.listAllVmBackups())
)
}