file-like objects returned from GET and used to POST do not have the same interface

Bug #773562 reported by Jay Pipes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Wishlist
Eoghan Glynn

Bug Description

From Vishy's question:

"I'm a bit lost as to why the client returns an iterator for get but then expects a file like object for add. It would be great if both of these worked the same way. Then it would be possible to do something like:

from glance import client

remote = client.Client('glance.provider.com')
local = client.Client('localhost')

metadata, image = remote.get_image(42)
local.add_image(metadata, image)"

There's no reason other than it's never been noticed until now :)

Revision history for this message
Jay Pipes (jaypipes) wrote :

This should be addressed in early Essex, along with the 2.0 Images API changes...

Changed in glance:
milestone: none → essex-1
Jay Pipes (jaypipes)
Changed in glance:
milestone: essex-1 → essex-2
Jay Pipes (jaypipes)
Changed in glance:
milestone: essex-2 → essex-3
Revision history for this message
Eoghan Glynn (eglynn) wrote :

Also maintaining tolerance for the image_data types currently supported by add_image (i.e. file-like or string) would be useful.

Changed in glance:
assignee: nobody → Eoghan Glynn (eglynn)
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/3307

Changed in glance:
status: Triaged → In Progress
Jay Pipes (jaypipes)
tags: added: consistency low-hanging-fruit
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/3307
Committed: http://github.com/openstack/glance/commit/7094e8926c623a59e5d5fa2b5a9cca13738a79fe
Submitter: Jenkins
Branch: master

commit 7094e8926c623a59e5d5fa2b5a9cca13738a79fe
Author: Eoghan Glynn <email address hidden>
Date: Mon Jan 23 13:22:53 2012 +0000

    Client.add_image() accepts image data as iterable.

    Fixes bug 773562

    Allow the image data to be passed to glance.Client.add_add_image()
    via an iterator, in addition to the previously accepted images types
    (file-like or string).

    Change-Id: I1f90b9875f5610d478a5ed123fbf431501f1c2b6

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: essex-3 → 2012.1
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.