Merge "Catch exception when image cache pruning"

This commit is contained in:
Jenkins 2014-03-14 06:58:29 +00:00 committed by Gerrit Code Review
commit 0e8773c14a
1 changed files with 6 additions and 2 deletions

View File

@ -280,8 +280,12 @@ class Driver(base.Driver):
return None
path = self.get_image_filepath(image_id)
file_info = os.stat(path)
return image_id, file_info[stat.ST_SIZE]
try:
file_info = os.stat(path)
size = file_info[stat.ST_SIZE]
except OSError:
size = 0
return image_id, size
@contextmanager
def open_for_write(self, image_id):