Fix force for VM stop/restart.
This commit is contained in:
parent
b1a8902e33
commit
a522e2bcbd
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user