F #4132: cancel actions when recovering

This commit is contained in:
Ruben S. Montero authored and GitHub committed 2020-06-11 13:21:17 +02:00
commit 2ef5b0e5c5
2 files changed
+7 -3

No files matched your search

+6 -2
View File
@@ -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)
+1 -1
View File
@@ -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