feat(xen-api): allow createTask in read-only mode (#2679)

Fixes #2678
This commit is contained in:
Julien Fontanet 2018-02-22 15:50:35 +01:00 committed by GitHub
parent 7ef314d9f4
commit 01a5963947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -418,11 +418,10 @@ export class Xapi extends EventEmitter {
}
// create a task and automatically destroy it when settled
//
// allowed even in read-only mode because it does not have impact on the
// XenServer and it's necessary for getResource()
createTask (nameLabel, nameDescription = '') {
if (this._readOnly) {
return Promise.reject(new Error('cannot create task in read only mode'))
}
const promise = this._sessionCall('task.create', [
nameLabel,
nameDescription,