You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
936 B
37 lines
936 B
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})`)
|
|
}
|
|
|
|
failure_message() {
|
|
return `Unable to reload service daemon on host "${this._host.name}."`
|
|
}
|
|
|
|
check_message() {
|
|
return `The service daemon on host "${this._host.name}" has not been reloaded.`
|
|
}
|
|
}
|
|
|
|
module.exports = exports = ServiceDaemonReloadState
|