mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-14 19:24:10 +03:00
Bug #451: Change OCCI return code when resource not found(cherry picked from commit 4928bb98688411dbcf361da0076fba6dc2a4f698)
This commit is contained in:
parent
2c68e039db
commit
4b2265c9fc
@ -198,6 +198,9 @@ class OCCIServer < CloudServer
|
||||
VirtualMachine.build_xml(params[:id]),
|
||||
get_client(request.env))
|
||||
|
||||
rc = vm.info
|
||||
return rc, 404 if OpenNebula::is_error?(rc)
|
||||
|
||||
# --- Finalize the VM ---
|
||||
result = vm.finalize
|
||||
return result, 500 if OpenNebula::is_error?(result)
|
||||
@ -337,6 +340,9 @@ class OCCIServer < CloudServer
|
||||
VirtualNetwork.build_xml(params[:id]),
|
||||
get_client(request.env))
|
||||
|
||||
rc = network.info
|
||||
return rc, 404 if OpenNebula::is_error?(rc)
|
||||
|
||||
# --- Delete the VNET ---
|
||||
rc = network.delete
|
||||
return rc, 500 if OpenNebula::is_error?(rc)
|
||||
@ -435,6 +441,9 @@ class OCCIServer < CloudServer
|
||||
Image.build_xml(params[:id]),
|
||||
get_client(request.env))
|
||||
|
||||
rc = image.info
|
||||
return rc, 404 if OpenNebula::is_error?(rc)
|
||||
|
||||
# --- Delete the Image ---
|
||||
rc = @img_repo.delete(image)
|
||||
return rc, 500 if OpenNebula::is_error?(rc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user