Skip to content

Commit

Permalink
rbd: remove another bad use of rbd.list
Browse files Browse the repository at this point in the history
  • Loading branch information
ctheune committed Nov 20, 2024
1 parent b340e88 commit 65b9549
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/fc/qemu/hazmat/ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,11 @@ def ensure(self):

def ensure_volume_presence(self, name, pool, size):
for ioctx in self.ioctxs.values():
if name in self.rbd.list(ioctx):
try:
rbd.Image(ioctx, name)
except rbd.ImageNotFound:
continue
else:
return
self.rbd.create(self.ioctxs[pool], name, size)

Expand Down

0 comments on commit 65b9549

Please sign in to comment.