maestro/app/classes/state/os/ServiceDaemonReloadState.js
2020-02-27 00:31:07 -06:00

29 lines
709 B
JavaScript

const State = require('../State')
class ServiceDaemonReloadState extends State {
static get services() {
return [...super.services, 'output']
}
constructor(host, config) {
if ( !host.services ) {
throw new Error(`Cannot apply service state to host ${host.name}: missing service manager API.`)
}
super(host, config)
}
async apply() {
return this._host.services.daemon_reload()
}
async check() {
return false
}
async reverse() {
this.output.warn(`Service daemon reload state does not currently support reversal. (Host: ${this._host.name})`)
}
}
module.exports = exports = ServiceDaemonReloadState