From 69b2b8cd008dbc2e999d33cf941f7b5531166145 Mon Sep 17 00:00:00 2001 From: Jens Rosenboom Date: Tue, 20 Sep 2016 12:37:47 +0200 Subject: Do not call image.stat() when we only need the size The image.stat() call seems to be broken in ceph-10.2.2, see [1]. Since we only need the size of the image, call image.size() instead [2]. [1] http://tracker.ceph.com/issues/17310 [2] http://docs.ceph.com/docs/jewel/rbd/librbdpy/#rbd.Image.size Change-Id: I82d411f886d8895e8a2e6cbb0907576c22f5f346 --- glance_store/_drivers/rbd.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/glance_store/_drivers/rbd.py b/glance_store/_drivers/rbd.py index ef9625c..d384705 100644 --- a/glance_store/_drivers/rbd.py +++ b/glance_store/_drivers/rbd.py @@ -240,8 +240,7 @@ class ImageIterator(object): with conn.open_ioctx(self.pool) as ioctx: with rbd.Image(ioctx, self.name, snapshot=self.snapshot) as image: - img_info = image.stat() - size = img_info['size'] + size = image.size() bytes_left = size while bytes_left > 0: length = min(self.chunk_size, bytes_left) -- cgit v1.2.1