Unclear behavior in V1 API when deleting a pending_delete image

Bug #1163020 reported by James Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
James Li

Bug Description

Glance version: Grizzly-rc1

'delay_delete' is ON in the following tests.

v1 api behavior

1st deletion:
- image status changes to 'pending_delete'
- Delete metadata (marked as deleted)
- return 200 - OK

2nd deletion:
- image status changes to 'deleted'.
- But still leave the image data for scrubber to delete.
- return 200- OK

3rd deletion:
- image status is still 'deleted'
- still leave the image data for scrubber to delete.
- return 403 - Forbidden

v2 api behavior

1st deletion:
- status changes to pending_delete
- return 204 No Content

2nd deletion
- status is still pending_delete
- return 404 Not Found

3rd deletion
- status is still pending_delete
- return 404 Not Found

So V2 behavior looks more clear and consistent, however v1 behavior looks vague.

Revision history for this message
Mark Washenberger (markwash) wrote :

Thanks for the clear description. It seems like we would get more clarity if the second deletion through v1 returned 403 Forbidden. Do you agree?

Revision history for this message
James Li (james-li-3) wrote :

Yeah, I agree. And it makes more sense to me if we don't change the status of the image and just keep it as 'pending_delete' in the 2nd and 3rd deletion of v1.

Revision history for this message
James Li (james-li-3) wrote :

I am looking into a fix for it now.

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/26802

Changed in glance:
assignee: nobody → James Li (james-li-3)
status: New → In Progress
Changed in glance:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/26802
Committed: http://github.com/openstack/glance/commit/cd008483747ff6825131365efc60cd787c36c310
Submitter: Jenkins
Branch: master

commit cd008483747ff6825131365efc60cd787c36c310
Author: James Li <email address hidden>
Date: Thu Apr 11 23:01:45 2013 +0000

    Fix the deletion of a pending_delete image.

    Return '403 - Forbidden' when trying to delete
    a 'pending_delete' image, and does not change
    its status.

    Change-Id: Id5b8b31c19d0f9da8aba66b06d1b966e9c33a363
    Fixes: bug #1163020

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → havana-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: havana-1 → 2013.2
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.