Glance image delete output

Bug #1333119 reported by Tzach Shefi
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Kamil Rykowski

Bug Description

Description of problem: Deleting a none existing image should always return same output.

Version-Release number of selected component (if applicable):
RHEL7
openstack-glance-2014.1-4.el7ost.noarch
python-glanceclient-0.12.0-1.el7ost.noarch
python-glance-2014.1-4.el7ost.noarch

How reproducible:
Every time

Steps to Reproduce:
1. Upload a test image glance image-create ...
2. Glance image-list note new image's ID
3. Delete that same image glance image-delete <imageID>
3. Note output ->
Request returned failure status.
404 not found
Image 07169a6f-bbce-4879-97d9-904fd69bb174 not found.
    (HTTP 404): Unable to delete image 07169a6f-bbce-4879-97d9-904fd69bb174

4. Now delete a none existing image glance image-delete <fakeImageID>
5. Output ->
Request returned failure status.
No image with a name or ID of '07169a6f-bbce-4879-97d9-904fd69bb179' exists.

Actual results:
See step 3 / 5 each one returns another output

Expected results:
It would be better if both deletions would return same output. Preferably this one -> No image with a name or ID of '....' exists.

From a user's stand point deleting a none existing image should always return same output, the fact that one of the images still has a DB listing which causes a different output is a bit misleading for someone not familiar with system's inner workings. If this unique output is a must maybe improve wording, "No image with name of ID.... exists, but there is an old listing in DB for it.. "

Revision history for this message
Tzach Shefi (tshefi) wrote :

Glance api.log it's a shared system not a clean log, sorry about that.

Revision history for this message
Kent Wang (k.wang) wrote :

Hi I wasn't able to reproduce step 3. There's no output on a successful deletion. Are you on the latest release?

Revision history for this message
Tzach Shefi (tshefi) wrote :

Hey Kent,

That's correct no error on image deletion, notice you were supposed to run that deletion command twice :)
See below step 3 to delete image (deleted no output), step 4 try to delete that same image you just deleted on step 3, only then do you get the misleading notice.

Glance version used:
openstack-glance-2014.1-4.el7ost.noarch
python-glanceclient-0.12.0-1.el7ost.noarch
python-glance-2014.1-4.el7ost.noarch

1. Uploaded an image
2. Image list to get it's ID

[root@puma31 ~(keystone_admin)]# glance image-list
+--------------------------------------+-------------+-------------+------------------+-----------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+-------------+-------------+------------------+-----------+--------+
| fa3406fa-ecef-44b8-a8e1-347203e40501 | twotwo | qcow2 | bare | 416309760 | active |
+--------------------------------------+-------------+-------------+------------------+-----------+--------+

3. Now delete that image, should work deleting the image as it should.

[root@puma31 ~(keystone_admin)]# glance image-delete fa3406fa-ecef-44b8-a8e1-347203e40501

4. Run exact same deletion command again, image delete will fail as no image is left to delete, yet notice reasoning.

[root@puma31 ~(keystone_admin)]# glance image-delete fa3406fa-ecef-44b8-a8e1-347203e40501
Request returned failure status.
404 Not Found
Image fa3406fa-ecef-44b8-a8e1-347203e40501 not found.
    (HTTP 404): Unable to delete image fa3406fa-ecef-44b8-a8e1-347203e40501

5. Now delete another image, this time use a fake none existing image ID

[root@puma31 ~(keystone_admin)]# glance image-delete fa3406fa-ecef-44b8-a8e1-347203e40522
Request returned failure status.
No image with a name or ID of 'fa3406fa-ecef-44b8-a8e1-347203e40522' exists.

My point being, compare outputs from steps 4 and 5.
Hope this clears things up.

Changed in glance:
assignee: nobody → tcs_openstack_group (tcs-openstack-group)
Revision history for this message
Rajani Srivastava (srivastava-rajani) wrote :
Changed in glance:
status: New → Fix Committed
Changed in glance:
assignee: tcs_openstack_group (tcs-openstack-group) → Rajani Srivastava (srivastava-rajani)
Revision history for this message
Dolph Mathews (dolph) wrote :

(given that the proposed fix has not merged, the correct status is still In Progress)

Changed in glance:
milestone: none → juno-rc1
status: Fix Committed → In Progress
milestone: juno-rc1 → none
importance: Undecided → Medium
Changed in glance:
assignee: Rajani Srivastava (srivastava-rajani) → Abhishek Talwar (abhishek-talwar)
Changed in glance:
assignee: Abhishek Talwar (abhishek-talwar) → Kamil Rykowski (kamil-rykowski)
Revision history for this message
Kamil Rykowski (kamil-rykowski) wrote :

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

Revision history for this message
Abhishek Talwar (abhishek-talwar) wrote :

Hi Kamil,

Thanks for co-authoring on my bug and adding the test cases. But I would like you to reassign this bug to me as I have been working on this from a long time.
So kindly re-assign it to me and we can get it merged together.

Thanks and Regards
Abhishek Talwar

Revision history for this message
Kamil Rykowski (kamil-rykowski) wrote :
Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: kilo-3 → 2015.1.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.