Comment 5 for bug 1039212

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

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

commit a6de4de65b01df6851fd573260fbbd8bbe53431f
Author: Dan Prince <email address hidden>
Date: Mon Aug 20 21:29:44 2012 -0400

    Convert limiting_iter to LimitingReader.

    Glance commit 3c69df5aa707b4216ef7001dbe28fa0a5912493c added a new
    limiting_iter function in utils which we use to limit reads to
    image data being uploaded. This simple generator doesn't work
    with image backends like the Swift store which require a 'read'
    method.

    This patch swaps out the simple limiting_iter function for a
    LimitingReader class which supports both 'read' and __iter__
    functions.

    Fixes LP Bug #1039212 which cause the exception below when used
    with the previous code:

    AttributeError: 'CooperativeReader' object has no attribute 'read'

    Change-Id: I87d9a30f7afe0207386d621050312374ced161d5