Skip to content

Commit

Permalink
fix for hypothetical situation when remote object exists and referenc…
Browse files Browse the repository at this point in the history
…e to it found on global region, after that object got deleted on remote region but global region attempting to use previously found reference for Centralized Administration. What happened is: attempt to execute queue item raising 'resource not found' and message requeud. Desired behavior: if resource not found then do not requeue message

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1689330
  • Loading branch information
yrudman committed Mar 20, 2019
1 parent fd4d265 commit 6601a1f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions app/models/mixins/process_tasks_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,10 @@ def invoke_api_tasks(api_client, remote_options)
resource_ids.each do |id|
begin
obj = collection.find(id)
rescue ManageIQ::API::Client::ResourceNotFound => err
_log.error(err.message)
else
_log.info("Invoking task #{action} on collection #{collection_name}, object #{obj.id}, with args #{post_args}")
begin
obj.send(action, post_args)
rescue NoMethodError => err
_log.error(err.message)
end
obj.send(action, post_args)
rescue NoMethodError, ManageIQ::API::Client::ResourceNotFound => err
_log.error(err.message)
end
end
else
Expand Down

0 comments on commit 6601a1f

Please sign in to comment.