Nir Soffer has uploaded a new change for review. Change subject: Revert "fileSD: improve error handling in deleteImage" ......................................................................
Revert "fileSD: improve error handling in deleteImage" This patch included by mistake https://gerrit.ovirt.org/51132, which should be merged separately. This reverts commit 0182e96fa4cf3ad833859184d01882f187ce36fa. Change-Id: If1a33b2ff0844f3561ac977189cb251745c44782 Signed-off-by: Nir Soffer <nsof...@redhat.com> --- M vdsm/storage/fileSD.py 1 file changed, 12 insertions(+), 14 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/51271/1 diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py index 9deabf3..ec46d18 100644 --- a/vdsm/storage/fileSD.py +++ b/vdsm/storage/fileSD.py @@ -395,26 +395,24 @@ raise se.ImageDeleteError("%s %s" % (imgUUID, str(e))) for volUUID in volsImgs: volPath = os.path.join(toDelDir, volUUID) - self._deleteVolumeFile(volPath) - self._deleteVolumeFile(volPath + '.meta') - if self.hasVolumeLeases(): - self._deleteVolumeFile(volPath + '.lease') + try: + self.log.debug("Removing file: %s", volPath) + self.oop.os.remove(volPath) + 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) + except OSError: + self.log.error("vol: %s can't be removed.", + volPath, exc_info=True) self.log.debug("Removing directory: %s", toDelDir) try: self.oop.os.rmdir(toDelDir) except OSError as e: self.log.error("removed image dir: %s can't be removed", toDelDir) raise se.ImageDeleteError("%s %s" % (imgUUID, str(e))) - - def _deleteVolumeFile(self, path): - self.log.debug("Removing file: %s", path) - try: - self.oop.os.remove(path) - except OSError as e: - if e.errno == errno.ENOENT: - self.log.warning("File %r does not exist: %s", path, e) - else: - self.log.error("File %r cannot be removed: %s", path, e) def zeroImage(self, sdUUID, imgUUID, volsImgs): self.log.warning("image %s on a fileSD %s won't be zeroed." % -- To view, visit https://gerrit.ovirt.org/51271 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1a33b2ff0844f3561ac977189cb251745c44782 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Nir Soffer <nsof...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches