Browse Source

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

stable/rocky
Zuul 1 week ago
parent
commit
8dc5bf8eea
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      cinder/backup/drivers/ceph.py

+ 7
- 7
cinder/backup/drivers/ceph.py View File

@@ -631,15 +631,15 @@ class CephBackupDriver(driver.BackupDriver):
631 631
                                         base_name, read_only=True))
632 632
         try:
633 633
             snaps = base_rbd.list_snaps()
634
-        finally:
635
-            base_rbd.close()
636 634
 
637
-        if snaps is None:
638
-            return False
635
+            if snaps is None:
636
+                return False
639 637
 
640
-        for snap in snaps:
641
-            if snap['name'] == snap_name:
642
-                return True
638
+            for snap in snaps:
639
+                if snap['name'] == snap_name:
640
+                    return True
641
+        finally:
642
+            base_rbd.close()
643 643
 
644 644
         return False
645 645
 

Loading…
Cancel
Save