Eduardo has uploaded a new change for review. Change subject: Remove unused image.preDeleteHandler(). ......................................................................
Remove unused image.preDeleteHandler(). Dead code remove. Change-Id: I6727a927f1b9ae82ee563ab51678d9b16651998a Signed-off-by: Eduardo <[email protected]> --- M vdsm/storage/image.py 1 file changed, 0 insertions(+), 37 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/55/8355/1 diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py index d004046..d008fc2 100644 --- a/vdsm/storage/image.py +++ b/vdsm/storage/image.py @@ -104,43 +104,6 @@ """ return os.path.join(self.repoPath, sdUUID, sd.DOMAIN_IMAGES, imgUUID) - def preDeleteHandler(self, sdUUID, imgUUID): - """ - Pre-delete handler for images on backup domain - """ - # We should handle 2 opposite scenarios: - # 1. Remove template's image: Create 'fake' template instead of deleted one - # 2. Remove regular image: Remove parent-'fake' template if nobody need it already - try: - pvol = self.getTemplate(sdUUID=sdUUID, imgUUID=imgUUID) - # 1. If we required to delete template's image that have VMs - # based on it, we should create similar 'fake' template instead - if pvol: - pvolParams = pvol.getVolumeParams() - # Find out real imgUUID of parent volume - pimg = pvolParams['imgUUID'] - # Check whether deleted image is a template itself - if imgUUID == pimg: - imglist = pvol.findImagesByVolume() - if len(imglist) > 1: - return pvolParams - - # 2. If we required to delete regular (non-template) image, we should also - # check its template (if exists) and in case that template is 'fake' - # and no VMs based on it, remove it too. - if pvol and pvol.isFake(): - # At this point 'pvol' is a fake template and we should find out all its children - chList = pvol.getAllChildrenList(self.repoPath, sdUUID, pimg, pvol.volUUID) - # If 'pvol' has more than one child don't touch it, else remove it - if len(chList) <= 1: - # Delete 'fake' parent image before deletion required image - # will avoid situation which new image based on this 'fake' parent - # can be created. - self._delete(sdUUID=sdUUID, imgUUID=pimg, postZero=False, force=True) - except se.StorageException: - self.log.warning("Image %s in domain %s had problem during deletion process", imgUUID, sdUUID, exc_info=True) - - return None def delete(self, sdUUID, imgUUID, postZero, force): """ -- To view, visit http://gerrit.ovirt.org/8355 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6727a927f1b9ae82ee563ab51678d9b16651998a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
