-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return Not Found on Snapshots Delete actions #15489
Return Not Found on Snapshots Delete actions #15489
Conversation
spec/requests/api/snapshots_spec.rb
Outdated
@@ -262,6 +279,29 @@ | |||
expect(response.parsed_body).to include(expected) | |||
expect(response).to have_http_status(:ok) | |||
end | |||
|
|||
it "raises a 404 with proper message if a resource isn't found" do | |||
api_basic_authorize(action_identifier(:vms, :delete, :snapshots_subresource_actions, :delete)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want the :post
action here, and :snaphots_subcollection_actions
(looks like this might be wrong in some of the examples above)
Checked commit jntullo@3ec4914 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
LGTM @jntullo Thanks for fixing this. 😍 |
…e_snapshot Return Not Found on Snapshots Delete actions (cherry picked from commit 0a3088e) https://bugzilla.redhat.com/show_bug.cgi?id=1478506
Fine backport details:
|
…se_delete_snapshot Return Not Found on Snapshots Delete actions (cherry picked from commit 0a3088e) https://bugzilla.redhat.com/show_bug.cgi?id=1478506
Currently the resource search for a snapshot happens within the rescue block, which means any resource search errors will be returned as a
200
with a"success":false
rather than the expected400 Not Found
. This PR moves the resource search out of the rescue block.BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1466225
@miq-bot add_label api, bug, fine/yes
cc: @imtayadeway