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

This commit is contained in:
Zuul 2019-08-23 16:24:07 +00:00 committed by Gerrit Code Review
commit 9422e0a596
1 changed files with 7 additions and 7 deletions

View File

@ -645,16 +645,16 @@ class CephBackupDriver(driver.BackupDriver):
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):