Fix the fetch of the stream generator

glanceclient is changed so we need to support different styles of
fetching the stream generator. either next(obj) or obj.next()

Change-Id: I88b3485917649c06f724cdda288f91ab2e41ad66
This commit is contained in:
Saad Zaher 2017-02-15 13:43:21 +00:00
parent a341023085
commit 97b5c35f01
1 changed files with 2 additions and 0 deletions

View File

@ -242,6 +242,8 @@ class ReSizeStream(object):
while not stop and len(self.reminder) < chunk_size:
try:
self.reminder += next(self.stream)
except TypeError:
self.reminder += self.stream.next()
except StopIteration:
stop = True
if stop: