mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 05:04:56 +09:00
F #4132: cancel actions when recovering
This commit is contained in:
2 files changed
+7
-3
No files matched your search
@@ -404,10 +404,14 @@ class ServiceLCM
|
||||
#
|
||||
# @param client [OpenNebula::Client] Client executing action
|
||||
# @param service_id [Integer] Service ID
|
||||
# @param delete [Boolean] True to recover delete a service
|
||||
#
|
||||
# @return [OpenNebula::Error] Error if any
|
||||
def recover_action(client, service_id)
|
||||
# TODO, kill other proceses? (other recovers)
|
||||
def recover_action(client, service_id, delete = false)
|
||||
@event_manager.cancel_action(service_id.to_i)
|
||||
|
||||
return undeploy_action(client, service_id, true) if delete
|
||||
|
||||
rc = @srv_pool.get(service_id, client) do |service|
|
||||
if service.can_recover_deploy?
|
||||
recover_deploy(client, service)
|
||||
|
||||
@@ -241,7 +241,7 @@ post '/service/:id/action' do
|
||||
case action['perform']
|
||||
when 'recover'
|
||||
if opts && opts['delete']
|
||||
rc = lcm.undeploy_action(@client, params[:id], true)
|
||||
rc = lcm.recover_action(@client, params[:id], true)
|
||||
else
|
||||
rc = lcm.recover_action(@client, params[:id])
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user