images.update() fails when image contains multiple tags

Bug #1306774 reported by Julien Vey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
High
Steve Lewis

Bug Description

When updating an image which contains multiple tags, glanceclient create the following request body for the PATCH method

'[{"path": "/tags/0", "value": "tag1", "op": "replace"},
{"path": "/tags/1", "value": "tag2", "op": "add"},
{"path": "/tags/2", "value": "tag3", "op": "add"}'),

This results in a 400 Bad Request "Invalid JSON pointer for this resource: '/tags/0'"

According to http://docs.openstack.org/api/openstack-image-service/2.0/content/update-an-image.html It should create the following, to be understood by the API

[{"path": "/tags", "value": ["tag1", "tag2", "tag3"], "op": "replace"}]'

Julien Vey (vey-julien)
Changed in python-glanceclient:
assignee: nobody → Julien Vey (vey-julien)
Julien Vey (vey-julien)
description: updated
Julien Vey (vey-julien)
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/87050

Changed in python-glanceclient:
status: New → In Progress
Changed in python-glanceclient:
assignee: Julien Vey (vey-julien) → Steve Lewis (steve-lewis)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/87050
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=f6f573316cfc2dd87ff7224590087e7f3be01b2e
Submitter: Jenkins
Branch: master

commit f6f573316cfc2dd87ff7224590087e7f3be01b2e
Author: Steve Lewis <email address hidden>
Date: Tue Mar 10 13:10:37 2015 -0700

    Apply expected patch format when updating tags in v2.images

    Currently, glanceclient.v2.update builds a patch request that does not
    match glance API.

    This patch overrides the default behaviour to customize the patch
    request with the right format for the API.

    Co-Authored-By: Steve Lewis <email address hidden>
    Fixes bug 1306774
    Change-Id: If0739ac285da1e741bfa40b6c719331a5ce49319

Changed in python-glanceclient:
status: In Progress → Fix Committed
Changed in python-glanceclient:
importance: Undecided → High
milestone: none → v0.17.0
status: Fix Committed → Fix Released
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.