diff options
author | Zuul <zuul@review.opendev.org> | 2019-10-07 21:23:27 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2019-10-07 21:23:28 +0000 |
commit | 2fa747ab78aefbd27598af71cc7fc557bd83ce94 (patch) | |
tree | b4b0c802e57726d9b4216a16ba3d4701f26a216e | |
parent | f03dc5d53ccb7fa9fb71e6b9ce4d221f8af8d786 (diff) | |
parent | 9e5d33ac244e8dce31ff6d2c7119ee4bd53a9908 (diff) | |
download | cinder-2fa747ab78aefbd27598af71cc7fc557bd83ce94.tar.gz |
Merge "Fix ceph: only close rbd image after snapshot iteration is finished" into stable/queens
-rw-r--r-- | cinder/backup/drivers/ceph.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cinder/backup/drivers/ceph.py b/cinder/backup/drivers/ceph.py index 248120910..285f53be5 100644 --- a/cinder/backup/drivers/ceph.py +++ b/cinder/backup/drivers/ceph.py @@ -631,15 +631,15 @@ class CephBackupDriver(driver.BackupDriver): base_name, read_only=True)) try: snaps = base_rbd.list_snaps() - finally: - base_rbd.close() - if snaps is None: - return False + if snaps is None: + return False - for snap in snaps: - if snap['name'] == snap_name: - return True + for snap in snaps: + if snap['name'] == snap_name: + return True + finally: + base_rbd.close() return False |