Respond to reboot and shutdown endpoints with a success object

Change-type: patch
Closes: #607
Signed-off-by: Cameron Diver <cameron@resin.io>
This commit is contained in:
Cameron Diver 2018-03-29 12:37:38 +01:00
parent b4fc2edfe2
commit 393671505c
No known key found for this signature in database
GPG Key ID: E76D7ACBEE436E12

View File

@ -368,9 +368,13 @@ module.exports = class DeviceState extends EventEmitter
else
switch step.action
when 'reboot'
@reboot(force, skipLock)
# There isn't really a way that these methods can fail,
# and if they do, we wouldn't know about it until after
# the response has been sent back to the API. Just return
# "OK" for this and the below action
@reboot(force, skipLock).return(Data: 'OK', Error: null)
when 'shutdown'
@shutdown(force, skipLock)
@shutdown(force, skipLock).return(Data: 'OK', Error: null)
when 'noop'
Promise.resolve()
else