Merge "Fix ceph: only close rbd image after snapshot iteration is finished" into stable/ocata

This commit is contained in:
Zuul
2019-10-11 18:27:56 +00:00
committed by Gerrit Code Review

View File

@@ -578,16 +578,16 @@ class CephBackupDriver(driver.BackupDriver):
base_rbd = self.rbd.Image(client.ioctx, base_name, read_only=True)
try:
snaps = base_rbd.list_snaps()
if snaps is None:
return False
for snap in snaps:
if snap['name'] == snap_name:
return True
finally:
base_rbd.close()
if snaps is None:
return False
for snap in snaps:
if snap['name'] == snap_name:
return True
return False
def _backup_rbd(self, backup, volume_file, volume_name, length):