Merge "Minor clean-up follow-up to timeout on read() fix"
This commit is contained in:
commit
c94fb84497
|
@ -282,7 +282,6 @@ class ImageDownload(object):
|
||||||
any reason.
|
any reason.
|
||||||
"""
|
"""
|
||||||
self._time = time_obj or time.time()
|
self._time = time_obj or time.time()
|
||||||
self._last_chunk_time = None
|
|
||||||
self._image_info = image_info
|
self._image_info = image_info
|
||||||
self._request = None
|
self._request = None
|
||||||
|
|
||||||
|
@ -344,6 +343,7 @@ class ImageDownload(object):
|
||||||
:returns: A chunk of the image. Size of chunk is IMAGE_CHUNK_SIZE
|
:returns: A chunk of the image. Size of chunk is IMAGE_CHUNK_SIZE
|
||||||
which is a constant in this module.
|
which is a constant in this module.
|
||||||
"""
|
"""
|
||||||
|
self._last_chunk_time = None
|
||||||
for chunk in self._request.iter_content(IMAGE_CHUNK_SIZE):
|
for chunk in self._request.iter_content(IMAGE_CHUNK_SIZE):
|
||||||
# Per requests forum posts/discussions, iter_content should
|
# Per requests forum posts/discussions, iter_content should
|
||||||
# periodically yield to the caller for the client to do things
|
# periodically yield to the caller for the client to do things
|
||||||
|
|
|
@ -1227,7 +1227,6 @@ class TestStandbyExtension(base.IronicAgentTest):
|
||||||
status_code = 200
|
status_code = 200
|
||||||
|
|
||||||
def __init__(self, url, stream, proxies, verify, cert, timeout):
|
def __init__(self, url, stream, proxies, verify, cert, timeout):
|
||||||
time.sleep(1)
|
|
||||||
self.count = 0
|
self.count = 0
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
|
@ -1237,12 +1236,8 @@ class TestStandbyExtension(base.IronicAgentTest):
|
||||||
if self.count == 1:
|
if self.count == 1:
|
||||||
time.sleep(4)
|
time.sleep(4)
|
||||||
return None
|
return None
|
||||||
if self.count < 3:
|
|
||||||
self.count += 1
|
self.count += 1
|
||||||
return "meow"
|
return "meow"
|
||||||
else:
|
|
||||||
time.sleep(30)
|
|
||||||
raise StopIteration
|
|
||||||
|
|
||||||
def iter_content(self, chunk_size):
|
def iter_content(self, chunk_size):
|
||||||
return self
|
return self
|
||||||
|
|
Loading…
Reference in New Issue