The client should check the update request before sending it to the server

Bug #1307412 reported by Flavio Percoco
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Triaged
Low
Unassigned

Bug Description

[root@orange-vdse ~(keystone_admin)]# glance --os-image-api-version 2 image-update fc4bfa83-6eea-4090-91a3-92b02668570d --owner 637ea20d137e4fa3bdbbb89ec513ef05Request returned failure status.
403 Forbidden
Attribute 'owner' is reserved.
    (HTTP 403)

However, if the owner remains unchanged, the client will send the request
to the server and not raise an error.

[fedora@cinder devstack]$ glance --os-image-api-version 2 image-update fc4bfa83-6eea-4090-91a3-92b02668570d --owner cf7d037795cd45919e9d2824c72d0bae
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 51bc16b900bf0f814bb6c0c3dd8f0790 |
| container_format | bare |
| created_at | 2014-05-02T10:36:23Z |
| disk_format | qcow2 |
| id | fc4bfa83-6eea-4090-91a3-92b02668570d |
| min_disk | 0 |
| min_ram | 0 |
| name | Fedora-x86_64-20-20131211.1-sda |
| owner | cf7d037795cd45919e9d2824c72d0bae |
| protected | False |
| size | 214106112 |
| status | active |
| tags | [] |
| updated_at | 2014-05-02T10:36:24Z |
| visibility | public |
+------------------+--------------------------------------+

Changed in glance:
importance: Undecided → Low
assignee: nobody → Flavio Percoco (flaper87)
Revision history for this message
Flavio Percoco (flaper87) wrote :

turns out the client is not sending the owner field update, which IMHO, is wrong. These kind of optimizations belong to the server, not the client. I'll move this bug to the client and update the title.

Changed in glance:
status: New → Invalid
status: Invalid → New
affects: glance → python-glanceclient
summary: - The API v2 reserved property error is not raised when there's nothing to
- update
+ The client should *always* send the full update request to the server
Changed in python-glanceclient:
assignee: Flavio Percoco (flaper87) → nobody
description: updated
Changed in python-glanceclient:
assignee: nobody → Cindy Pallares (cindy-pallaresq)
Changed in python-glanceclient:
status: New → In Progress
Revision history for this message
Erno Kuvaja (jokke) wrote : Re: The client should *always* send the full update request to the server

IMO the client should tell the user that the operation was not attempted due to no-change situation and fail early as we do in other similar cases (image create with known not working conditions, etc.). I don't think, we should send request to the server where we know already that the server is not going to do anything about it.

Revision history for this message
Cindy Pallares (cpallares) wrote :

Erno, perhaps there is something I am missing, but how should the client know it is a no-change situation? Doesn't it have to send the request to the server and get a response to compare?

summary: - The client should *always* send the full update request to the server
+ The client should check the update request before sending it to the
+ server
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-glanceclient (master)

Change abandoned by Cindy Pallares (<email address hidden>) on branch: master
Review: https://review.openstack.org/99413

Revision history for this message
Erno Kuvaja (jokke) wrote :

Hi Cindy,

I was wrong about our current state and how we did that cleanup of those parameters. We had lengthy conversation with Flavio around this and what we probably should do is clean out that whole fetching the object beforehand and sanitizing our request from that cache and rather just format the request based on the schema and send it out to the server.

Let me know what do you think about that.

Honestly I did not read the change itself and my comments were based on the bug and the commit message. I'm sorry I missed your response.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Glance Bot (<email address hidden>) on branch: master
Review: https://review.openstack.org/185223

Changed in python-glanceclient:
assignee: Cindy Pallares (cpallares) → nobody
Preeti (pandey-preeti1)
Changed in python-glanceclient:
assignee: nobody → Preeti (pandey-preeti1)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

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

Ian Cordasco (icordasc)
Changed in python-glanceclient:
status: In Progress → Confirmed
assignee: Preeti (pandey-preeti1) → nobody
importance: Low → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-glanceclient (master)

Change abandoned by Brian Rosmaita (<email address hidden>) on branch: master
Review: https://review.openstack.org/302572
Reason: No activity in >1 year.

Changed in python-glanceclient:
importance: Medium → Low
status: Confirmed → Triaged
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.