Revision cd8f54c0
Added by Ivan Necas almost 7 years ago
app/models/compute_resources/foreman/model/ovirt.rb | ||
---|---|---|
end
|
||
|
||
def destroy_vm(uuid)
|
||
begin
|
||
find_vm_by_uuid(uuid).destroy
|
||
rescue OVIRT::OvirtException => e
|
||
#404 error are ignored on delete.
|
||
raise e unless e.message =~ /404/
|
||
end
|
||
find_vm_by_uuid(uuid).destroy
|
||
rescue ActiveRecord::RecordNotFound
|
||
true
|
||
end
|
||
|
Also available in: Unified diff
Fixes #19236 - handle situation when host is destroyed oVirt
The issue was introduced in 4269abbd, where we replaced the
`OVIRT::OvirtException` error by `ActiveRecord::RecordNotFound` in
`find_vm_by_uuid method`, but we haven't updated the corresponding
`rescue` block in `destroy_vm`.
(cherry picked from commit 736cb75f3d41d6a4d847556497574957342ca816)