cloud: docker: Fixes #22638 load image to memory when archive_path provided (#22642)

(cherry picked from commit dba8edf735)
pull/22755/head
Ilya Simonenko 8 years ago committed by Matt Davis
parent c72ac9b230
commit e9439c54f6

@ -394,9 +394,9 @@ class ImageManager(DockerBaseClass):
self.fail("Error getting image %s - %s" % (image_name, str(exc))) self.fail("Error getting image %s - %s" % (image_name, str(exc)))
try: try:
image_tar = open(self.archive_path, 'w') with open(self.archive_path, 'w') as fd:
image_tar.write(image.data) for chunk in image.stream(2048, decode_content=False):
image_tar.close() fd.write(chunk)
except Exception as exc: except Exception as exc:
self.fail("Error writing image archive %s - %s" % (self.archive_path, str(exc))) self.fail("Error writing image archive %s - %s" % (self.archive_path, str(exc)))

Loading…
Cancel
Save