Attempting to get/delete image member that does not exist returns 404 response with incorrect message

Bug #1444129 reported by Luke Wollney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Deepti Ramakrishna

Bug Description

Overview:
When attempting to get/delete image member that does not exist, a 404 response is returned, but with an incorrect message.

Steps to reproduce:
1) Create an image
2) Try to get or delete image member, passing 'dne' as member id via:
DELETE /images/<image_id>/members/dne
3) Notice that a 404 response is returned and that the message reads 'Image <image_id> not found'

Expected:
A 404 response containing a message that reads 'Image member not found'

Actual:
A 404 response with a message that reads 'Image <image_id> not found'

Changed in glance:
assignee: nobody → Deepti Ramakrishna (dramakri)
tags: added: low-hanging-fruit
summary: - Attempting to delete image member that does not exist returns 404
- response, but with an incorrect message
+ Attempting to get/delete image member that does not exist returns 404
+ response with incorrect message
description: updated
Changed in glance:
importance: Undecided → Critical
importance: Critical → Low
Changed in glance:
status: New → Confirmed
Revision history for this message
Deepti Ramakrishna (dramakri) wrote :

This bug is applicable only for v2 api. For v1 api, we get a "405 Method Not Allowed" response, for which there is a separate bug #1326955 (which is marked as "Won't Fix" BTW).

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/178997

Changed in glance:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/178997
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=020b21d7164f1995b4a6c36f5aafcaac6e675445
Submitter: Jenkins
Branch: master

commit 020b21d7164f1995b4a6c36f5aafcaac6e675445
Author: Deepti Ramakrishna <email address hidden>
Date: Sun Jun 28 22:48:29 2015 -0700

    Refactoring of image-members v2 API implementation.

    The refactoring is motivated by multiple issues in the current code:
    - Exceptions thrown by image lookup as well as member lookup are handled in
      the same try-except block and handled as if it was only the image lookup
      that failed.
    - Does not take into account that in v2, trying to do any operation on a
      public image members should throw 403 Forbidden error. As a result, the
      current response messages for operations on a public image show an
      "Unauthorized" error message even for admin rather than the more accurate
      "Public images do not have any members" error message.

    Change-Id: Icf73841fbd10204db689b2b28451434ebaf10087
    Closes-Bug: #1444129

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: liberty-2 → 11.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.