diff --git a/src/api/acl.js b/src/api/acl.js index 91837e094..103f17043 100644 --- a/src/api/acl.js +++ b/src/api/acl.js @@ -1,5 +1,5 @@ export async function get () { - return await this.getAllAcls() + return /* await */ this.getAllAcls() } get.permission = 'admin' @@ -9,7 +9,7 @@ get.description = 'get existing ACLs' // ------------------------------------------------------------------- export async function getCurrentPermissions () { - return await this.getPermissionsForUser(this.session.get('user_id')) + return /* await */ this.getPermissionsForUser(this.session.get('user_id')) } getCurrentPermissions.permission = '' diff --git a/src/api/group.js b/src/api/group.js index 0f5e28139..97b8bb531 100644 --- a/src/api/group.js +++ b/src/api/group.js @@ -27,7 +27,7 @@ delete_.params = { // ------------------------------------------------------------------- export async function getAll () { - return await this.getAllGroups() + return /* await */ this.getAllGroups() } getAll.description = 'returns all the existing group' diff --git a/src/api/job.js b/src/api/job.js index e6685cc97..496cb43e9 100644 --- a/src/api/job.js +++ b/src/api/job.js @@ -1,14 +1,14 @@ // FIXME so far, no acls for jobs export async function getAll () { - return await this.getAllJobs() + return /* await */ this.getAllJobs() } getAll.permission = 'admin' getAll.description = 'Gets all available jobs' export async function get (id) { - return await this.getJob(id) + return /* await */ this.getJob(id) } get.permission = 'admin' diff --git a/src/api/plugin.js b/src/api/plugin.js index 29593966c..da2166673 100644 --- a/src/api/plugin.js +++ b/src/api/plugin.js @@ -1,5 +1,5 @@ export async function get () { - return await this.getPlugins() + return /* await */ this.getPlugins() } get.description = 'returns a list of all installed plugins' diff --git a/src/api/remote.js b/src/api/remote.js index fb191297f..671e74fbc 100644 --- a/src/api/remote.js +++ b/src/api/remote.js @@ -1,12 +1,12 @@ export async function getAll () { - return await this.getAllRemotes() + return /* await */ this.getAllRemotes() } getAll.permission = 'admin' getAll.description = 'Gets all existing fs remote points' export async function get ({id}) { - return await this.getRemote(id) + return /* await */ this.getRemote(id) } get.permission = 'admin' @@ -16,7 +16,7 @@ get.params = { } export async function list ({id}) { - return await this.listRemoteBackups(id) + return /* await */ this.listRemoteBackups(id) } list.permission = 'admin' @@ -26,7 +26,7 @@ list.params = { } export async function create ({name, url}) { - return await this.createRemote({name, url}) + return /* await */ this.createRemote({name, url}) } create.permission = 'admin' diff --git a/src/api/role.js b/src/api/role.js index 6e5d13b14..8f67d2b2d 100644 --- a/src/api/role.js +++ b/src/api/role.js @@ -1,3 +1,3 @@ export async function getAll () { - return await this.getRoles() + return /* await */ this.getRoles() } diff --git a/src/api/schedule.js b/src/api/schedule.js index d51ce7037..eb47a2d22 100644 --- a/src/api/schedule.js +++ b/src/api/schedule.js @@ -1,14 +1,14 @@ // FIXME so far, no acls for schedules export async function getAll () { - return await this.getAllSchedules() + return /* await */ this.getAllSchedules() } getAll.permission = 'admin' getAll.description = 'Gets all existing schedules' export async function get (id) { - return await this.getSchedule(id) + return /* await */ this.getSchedule(id) } get.permission = 'admin' @@ -18,7 +18,7 @@ get.params = { } export async function create ({jobId, cron, enabled, name}) { - return await this.createSchedule(this.session.get('user_id'), {job: jobId, cron, enabled, name}) + return /* await */ this.createSchedule(this.session.get('user_id'), {job: jobId, cron, enabled, name}) } create.permission = 'admin' diff --git a/src/collection.js b/src/collection.js index bb655cadb..22661823c 100644 --- a/src/collection.js +++ b/src/collection.js @@ -84,7 +84,7 @@ export default class Collection extends EventEmitter { : {} } - return await this._get(properties) + return /* await */ this._get(properties) } async remove (ids) { diff --git a/src/models/group.js b/src/models/group.js index 77b6a3a43..80dde4891 100644 --- a/src/models/group.js +++ b/src/models/group.js @@ -29,7 +29,7 @@ export class Groups extends Collection { // Serializes. group.users = JSON.stringify(group.users) - return await this.update(group) + return /* await */ this.update(group) } async get (properties) { diff --git a/src/models/job.js b/src/models/job.js index 7221bcfff..1635c0f9a 100644 --- a/src/models/job.js +++ b/src/models/job.js @@ -19,13 +19,13 @@ export class Jobs extends Collection { job.userId = userId // Serializes. job.paramsVector = JSON.stringify(job.paramsVector) - return await this.add(new Job(job)) + return /* await */ this.add(new Job(job)) } async save (job) { // Serializes. job.paramsVector = JSON.stringify(job.paramsVector) - return await this.update(job) + return /* await */ this.update(job) } async get (properties) { diff --git a/src/models/plugin-metadata.js b/src/models/plugin-metadata.js index 985bf5beb..85fc1a8c5 100644 --- a/src/models/plugin-metadata.js +++ b/src/models/plugin-metadata.js @@ -18,7 +18,7 @@ export class PluginsMetadata extends Collection { } async save ({ id, autoload, configuration }) { - return await this.update({ + return /* await */ this.update({ id, autoload: autoload ? 'true' : 'false', configuration: configuration && JSON.stringify(configuration) @@ -31,7 +31,7 @@ export class PluginsMetadata extends Collection { throw new Error('no such plugin metadata') } - return await this.save({ + return /* await */ this.save({ ...pluginMetadata.properties, ...data }) diff --git a/src/models/remote.js b/src/models/remote.js index e99ca7891..b37953fad 100644 --- a/src/models/remote.js +++ b/src/models/remote.js @@ -27,7 +27,7 @@ export class Remotes extends Collection { } async save (remote) { - return await this.update(remote) + return /* await */ this.update(remote) } async get (properties) { diff --git a/src/models/schedule.js b/src/models/schedule.js index 31a7a2fbe..5ae571798 100644 --- a/src/models/schedule.js +++ b/src/models/schedule.js @@ -26,7 +26,7 @@ export class Schedules extends Collection { } async save (schedule) { - return await this.update(schedule) + return /* await */ this.update(schedule) } async get (properties) { diff --git a/src/models/server.js b/src/models/server.js index ddde7763f..a542ccbb4 100644 --- a/src/models/server.js +++ b/src/models/server.js @@ -17,6 +17,6 @@ export class Servers extends Collection { throw new Error('server already exists') } - return await this.add({host, username, password, readOnly}) + return /* await */ this.add({host, username, password, readOnly}) } } diff --git a/src/models/user.js b/src/models/user.js index 76f7a38f6..ce65e28b6 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -30,14 +30,14 @@ export class Users extends Collection { const user = new User(properties) // Adds the user to the collection. - return await this.add(user) + return /* await */ this.add(user) } async save (user) { // Serializes. user.groups = JSON.stringify(user.groups) - return await this.update(user) + return /* await */ this.update(user) } async get (properties) { diff --git a/src/xapi.js b/src/xapi.js index d311dd2c3..00402b305 100644 --- a/src/xapi.js +++ b/src/xapi.js @@ -677,7 +677,7 @@ export default class Xapi extends XapiBase { } async installPoolPatchOnHost (patchUuid, hostId) { - return await this._installPoolPatchOnHost( + return /* await */ this._installPoolPatchOnHost( patchUuid, this.getObject(hostId) ) @@ -835,7 +835,7 @@ export default class Xapi extends XapiBase { }`) try { - return await this.call( + return /* await */ this.call( 'VM.copy', snapshotRef || vm.$ref, nameLabel, @@ -889,13 +889,13 @@ export default class Xapi extends XapiBase { : this._copyVm(vm, nameLabel) ) - return await this._getOrWaitObject(cloneRef) + return /* await */ this._getOrWaitObject(cloneRef) } async copyVm (vmId, srId, { nameLabel = undefined } = {}) { - return await this._getOrWaitObject( + return /* await */ this._getOrWaitObject( await this._copyVm( this.getObject(vmId), nameLabel, @@ -1230,7 +1230,7 @@ export default class Xapi extends XapiBase { } async deleteVm (vmId, deleteDisks = false) { - return await this._deleteVm( + return /* await */ this._deleteVm( this.getObject(vmId), deleteDisks ) @@ -1632,7 +1632,7 @@ export default class Xapi extends XapiBase { onlyMetadata = false, srId } = {}) { - return await this._getOrWaitObject(await this._importVm( + return /* await */ this._getOrWaitObject(await this._importVm( stream, srId && this.getObject(srId), onlyMetadata @@ -1680,7 +1680,7 @@ export default class Xapi extends XapiBase { } async snapshotVm (vmId, nameLabel = undefined) { - return await this._getOrWaitObject( + return /* await */ this._getOrWaitObject( await this._snapshotVm( this.getObject(vmId), nameLabel @@ -1896,7 +1896,7 @@ export default class Xapi extends XapiBase { data.xenstore_data = xenstore_data } - return await this.call('VDI.create', data) + return /* await */ this.call('VDI.create', data) } async moveVdi (vdiId, srId) { @@ -2030,7 +2030,7 @@ export default class Xapi extends XapiBase { } async createVdi (size, opts) { - return await this._getOrWaitObject( + return /* await */ this._getOrWaitObject( await this._createVdi(size, opts) ) } @@ -2206,7 +2206,7 @@ export default class Xapi extends XapiBase { } async createVif (vmId, networkId, opts = undefined) { - return await this._getOrWaitObject( + return /* await */ this._getOrWaitObject( await this._createVif( this.getObject(vmId), this.getObject(networkId), @@ -2225,7 +2225,7 @@ export default class Xapi extends XapiBase { const vm = this.getObject(vmId) const host = vm.$resident_on || this.pool.$master - return await this.call('host.call_plugin', host.$ref, 'xscontainer', action, { + return /* await */ this.call('host.call_plugin', host.$ref, 'xscontainer', action, { vmuuid: vm.uuid, container: containerId }) diff --git a/src/xo-mixins/backups.js b/src/xo-mixins/backups.js index 5891d0e6c..e280a8b48 100644 --- a/src/xo-mixins/backups.js +++ b/src/xo-mixins/backups.js @@ -180,7 +180,7 @@ export default class { const getPath = (file, dir) => dir ? `${dir}/${file}` : file await Promise.all( - mapToArray(backups.slice(0, n), async backup => await handler.unlink(getPath(backup, dir))) + mapToArray(backups.slice(0, n), async backup => /* await */ handler.unlink(getPath(backup, dir))) ) } @@ -214,7 +214,7 @@ export default class { // Import vm metadata. const vm = await (async () => { const stream = await handler.createReadStream(`${filePath}.xva`) - return await xapi.importVm(stream, { onlyMetadata: true }) + return /* await */ xapi.importVm(stream, { onlyMetadata: true }) })() const vmName = vm.name_label @@ -431,7 +431,7 @@ export default class { async _listDeltaVmBackups (handler, dir) { const files = await handler.list(dir) - return await sortBy(filter(files, isDeltaBackup)) + return /* await */ sortBy(filter(files, isDeltaBackup)) } async _failedRollingDeltaVmBackup (xapi, handler, dir, fulFilledVdiBackups) { diff --git a/src/xo-mixins/jobs.js b/src/xo-mixins/jobs.js index a0273786d..d17fd588b 100644 --- a/src/xo-mixins/jobs.js +++ b/src/xo-mixins/jobs.js @@ -26,7 +26,7 @@ export default class { } async getAllJobs () { - return await this._jobs.get() + return /* await */ this._jobs.get() } async getJob (id) { @@ -45,11 +45,11 @@ export default class { } async updateJob (job) { - return await this._jobs.save(job) + return /* await */ this._jobs.save(job) } async removeJob (id) { - return await this._jobs.remove(id) + return /* await */ this._jobs.remove(id) } async runJobSequence (idSequence) { diff --git a/src/xo-mixins/plugins.js b/src/xo-mixins/plugins.js index 4f00f0822..3121d65ae 100644 --- a/src/xo-mixins/plugins.js +++ b/src/xo-mixins/plugins.js @@ -122,7 +122,7 @@ export default class { } async getPlugins () { - return await Promise.all( + return /* await */ Promise.all( mapToArray(this._plugins, ({ id }) => this._getPlugin(id)) ) } diff --git a/src/xo-mixins/remotes.js b/src/xo-mixins/remotes.js index e6ec7d479..9f884b90b 100644 --- a/src/xo-mixins/remotes.js +++ b/src/xo-mixins/remotes.js @@ -71,7 +71,7 @@ export default class { async createRemote ({name, url}) { let remote = await this._remotes.create(name, url) - return await this.updateRemote(remote.get('id'), {enabled: true}) + return /* await */ this.updateRemote(remote.get('id'), {enabled: true}) } async updateRemote (id, {name, url, enabled, error}) { diff --git a/src/xo-mixins/scheduling.js b/src/xo-mixins/scheduling.js index 6e2805547..a72fd6acc 100644 --- a/src/xo-mixins/scheduling.js +++ b/src/xo-mixins/scheduling.js @@ -134,7 +134,7 @@ export default class { } async getAllSchedules () { - return await this._redisSchedules.get() + return /* await */ this._redisSchedules.get() } async createSchedule (userId, {job, cron, enabled, name}) { diff --git a/src/xo-mixins/subjects.js b/src/xo-mixins/subjects.js index de6e6bc85..f7c20715a 100644 --- a/src/xo-mixins/subjects.js +++ b/src/xo-mixins/subjects.js @@ -184,7 +184,7 @@ export default class { throw new Error(`registering ${name} user is forbidden`) } - return await this.createUser(name, { + return /* await */ this.createUser(name, { _provider: provider }) }