|
|
@ -426,6 +426,7 @@ image:
|
|
|
|
sample: {}
|
|
|
|
sample: {}
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import errno
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import re
|
|
|
|
import traceback
|
|
|
|
import traceback
|
|
|
@ -787,20 +788,15 @@ class ImageManager(DockerBaseClass):
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
self.log("Opening image %s" % self.load_path)
|
|
|
|
self.log("Opening image %s" % self.load_path)
|
|
|
|
image_tar = open(self.load_path, 'rb')
|
|
|
|
with open(self.load_path, 'rb') as image_tar:
|
|
|
|
except Exception as exc:
|
|
|
|
self.log("Loading image from %s" % self.load_path)
|
|
|
|
self.fail("Error opening image %s - %s" % (self.load_path, str(exc)))
|
|
|
|
self.client.load_image(image_tar)
|
|
|
|
|
|
|
|
except EnvironmentError as exc:
|
|
|
|
try:
|
|
|
|
if exc.errno == errno.ENOENT:
|
|
|
|
self.log("Loading image from %s" % self.load_path)
|
|
|
|
self.fail("Error opening image %s - %s" % (self.load_path, str(exc)))
|
|
|
|
self.client.load_image(image_tar)
|
|
|
|
|
|
|
|
except Exception as exc:
|
|
|
|
|
|
|
|
self.fail("Error loading image %s - %s" % (self.name, str(exc)))
|
|
|
|
self.fail("Error loading image %s - %s" % (self.name, str(exc)))
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
image_tar.close()
|
|
|
|
|
|
|
|
except Exception as exc:
|
|
|
|
except Exception as exc:
|
|
|
|
self.fail("Error closing image %s - %s" % (self.name, str(exc)))
|
|
|
|
self.fail("Error loading image %s - %s" % (self.name, str(exc)))
|
|
|
|
|
|
|
|
|
|
|
|
return self.client.find_image(self.name, self.tag)
|
|
|
|
return self.client.find_image(self.name, self.tag)
|
|
|
|
|
|
|
|
|
|
|
|