Comment 4 for bug 1734832

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

Reviewed: https://review.openstack.org/523366
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=ffc3923e93dc1d4eea789ce5163d176efb7d685b
Submitter: Zuul
Branch: master

commit ffc3923e93dc1d4eea789ce5163d176efb7d685b
Author: Abhishek Kekane <email address hidden>
Date: Tue Nov 28 09:51:02 2017 +0000

    Fix unreachable 'ImageSizeLimitExceeded' exception in image-upload

    ImageSizeLimitExceeded exception block [1] is unreachable in upload because
    it is caught at [2] and raised StorageQuotaFull exception from there. The
    problem here is that we have nested usage of the limiting reader.

    To make it correct changed the limiting reader to accept
    exception class as parameter so that we can pass the StorageQuotaFull
    in case LimitingReader is used for quota check and ImageSizeExceeded exception
    if it is used for image size cap check.

    [1] https://github.com/openstack/glance/blob/fd16fa4f258fd3f77c14900a019e97bb90bc5ac0/glance/api/v2/image_data.py#L230
    [2] https://github.com/openstack/glance/blob/fd16fa4f258fd3f77c14900a019e97bb90bc5ac0/glance/quota/__init__.py#L305

    Closes-Bug: #1734832
    Change-Id: I5a419b763bee7f983c2a94c6f3a2245281e86743