Fix force for VM stop/restart.

This commit is contained in:
Julien Fontanet 2014-02-06 16:39:26 +01:00
parent b1a8902e33
commit a522e2bcbd

View File

@ -383,7 +383,9 @@ exports.restart = ->
# Attempts a clean reboot.
xapi.call 'VM.clean_reboot', VM.ref
catch error
throw error unless error[0] is 'VM_MISSING_PV_DRIVERS'
return unless error[0] is 'VM_MISSING_PV_DRIVERS'
@throw 'INVALID_PARAMS' unless force
xapi.call 'VM.hard_reboot', VM.ref
@ -430,7 +432,9 @@ exports.stop = ->
# Attempts a clean shutdown.
xapi.call 'VM.clean_shutdown', VM.ref
catch error
throw error unless error[0] is 'VM_MISSING_PV_DRIVERS'
return unless error[0] is 'VM_MISSING_PV_DRIVERS'
@throw 'INVALID_PARAMS' unless force
xapi.call 'VM.hard_shutdown', VM.ref