Change in vdsm[ovirt-3.6]: fileSD: Do not try to remove non-existent lease file

nsoffer at redhat.com nsoffer at redhat.com
Mon Dec 28 23:03:12 UTC 2015


Hello Adam Litke, Liron Aravot,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/51132

to review the following change.

Change subject: fileSD: Do not try to remove non-existent lease file
......................................................................

fileSD: Do not try to remove non-existent lease file

The volume.lease file exists only if a domain has volume leases. Avoid
removing the non-existent lease file and the bogus exception in the log
when the operation "fails".

This is the same patch from master, applied to FileStorageDomain instead
of FileStorageDomainManifest, since deleteImage was not moved to the
manifest class in 3.6.

Change-Id: I525704678707dfef40e34497bc4917dd19d73034
Bug-Url: https://bugzilla.redhat.com/1291207
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/50589
Continuous-Integration: Jenkins CI
Reviewed-by: Allon Mureinik <amureini at redhat.com>
Reviewed-by: Adam Litke <alitke at redhat.com>
Reviewed-by: Liron Aravot <laravot at redhat.com>
---
M vdsm/storage/fileSD.py
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/51132/1

diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index ec46d18..1280a83 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -401,9 +401,10 @@
                 metaFile = volPath + '.meta'
                 self.log.debug("Removing file: %s", metaFile)
                 self.oop.os.remove(metaFile)
-                leaseFile = volPath + '.lease'
-                self.log.debug("Removing file: %s", leaseFile)
-                self.oop.os.remove(leaseFile)
+                if self.hasVolumeLeases():
+                    leaseFile = volPath + '.lease'
+                    self.log.debug("Removing file: %s", leaseFile)
+                    self.oop.os.remove(leaseFile)
             except OSError:
                 self.log.error("vol: %s can't be removed.",
                                volPath, exc_info=True)


-- 
To view, visit https://gerrit.ovirt.org/51132
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I525704678707dfef40e34497bc4917dd19d73034
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Liron Aravot <laravot at redhat.com>


More information about the vdsm-patches mailing list