glance/glance/quota
Abhishek Kekane ffc3923e93 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] fd16fa4f25/glance/api/v2/image_data.py (L230)
[2] fd16fa4f25/glance/quota/__init__.py (L305)

Closes-Bug: #1734832
Change-Id: I5a419b763bee7f983c2a94c6f3a2245281e86743
2018-05-30 04:53:30 +00:00
..
__init__.py Fix unreachable 'ImageSizeLimitExceeded' exception in image-upload 2018-05-30 04:53:30 +00:00