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.
Reviewed: https:/ /review. openstack. org/523366 /git.openstack. org/cgit/ openstack/ glance/ commit/ ?id=ffc3923e93d c1d4eea789ce516 3d176efb7d685b
Committed: https:/
Submitter: Zuul
Branch: master
commit ffc3923e93dc1d4 eea789ce5163d17 6efb7d685b
Author: Abhishek Kekane <email address hidden>
Date: Tue Nov 28 09:51:02 2017 +0000
Fix unreachable 'ImageSizeLimit Exceeded' exception in image-upload
ImageSizeLi mitExceeded 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/fd16fa4f25 8fd3f77c14900a0 19e97bb90bc5ac0 /glance/ api/v2/ image_data. py#L230 /github. com/openstack/ glance/ blob/fd16fa4f25 8fd3f77c14900a0 19e97bb90bc5ac0 /glance/ quota/_ _init__ .py#L305
[2] https:/
Closes-Bug: #1734832 983c2a94c6f3a22 45281e86743
Change-Id: I5a419b763bee7f