Do not raise StopIteration

The current code will not work in Python3.7 because of PEP479. This
commit fixes it so that it works with both 3.6 and 3.7.

[1] https://www.python.org/dev/peps/pep-0479/

Closes-bug: #1815335
Change-Id: I6adf23e0569db8655806a07d53c5000f5fd0918f
This commit is contained in:
Cyril Roelandt 2019-02-11 18:56:21 +01:00 committed by Sean McGinnis
parent db75918208
commit d54ee8437f
2 changed files with 2 additions and 2 deletions

View File

@ -241,7 +241,7 @@ class ImageIterator(object):
data = image.read(size - bytes_left, length)
bytes_left -= len(data)
yield data
raise StopIteration()
return
except rbd.ImageNotFound:
raise exceptions.NotFound(
_('RBD image %s does not exist') % self.name)

View File

@ -256,7 +256,7 @@ class ImageIterator(object):
data = image.read(total - left, length)
left -= len(data)
yield data
raise StopIteration()
return
class Store(glance_store.driver.Store):