summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Rosenboom <j.rosenboom@x-ion.de>2016-09-20 12:37:47 +0200
committerJens Rosenboom <j.rosenboom@x-ion.de>2016-09-20 12:42:29 +0200
commit69b2b8cd008dbc2e999d33cf941f7b5531166145 (patch)
treeac0f7cf79eecac21c154237d291c17e845386b54
parentd7f59dbb13b5ca1498a64dedba20de251f43345f (diff)
downloadglance_store-69b2b8cd008dbc2e999d33cf941f7b5531166145.tar.gz
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
-rw-r--r--glance_store/_drivers/rbd.py3
1 files changed, 1 insertions, 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)