Eduardo has uploaded a new change for review.

Change subject: BZ#836161 - Remove preDeleteRename().
......................................................................

BZ#836161 - Remove preDeleteRename().

Change-Id: I2452594c701eb9c3ccbab7de92e8fca69f033074
Signed-off-by: Eduardo <[email protected]>
---
M vdsm/storage/image.py
M vdsm/storage/sp.py
2 files changed, 0 insertions(+), 35 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/8508/1

diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 9a22863..5871c3a 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -214,37 +214,6 @@
         randomStr = misc.randomStr(RENAME_RANDOM_STRING_LEN)
         return "%s%s_%s" % (REMOVED_IMAGE_PREFIX, randomStr, uuid)
 
-    def preDeleteRename(self, sdUUID, imgUUID):
-        # Get the list of the volumes
-        volclass = sdCache.produce(sdUUID).getVolumeClass()
-        uuidlist = volclass.getImageVolumes(self.repoPath, sdUUID, imgUUID)
-        imageDir = self.getImageDir(sdUUID, imgUUID)
-
-        # If image directory doesn't exist we are done
-        if not os.path.exists(imageDir):
-            return imgUUID
-
-        # Otherwise move it out of the way
-        newImgUUID = self.deletedVolumeName(imgUUID)
-        self.log.info("Rename image %s -> %s", imgUUID, newImgUUID)
-        if not imgUUID.startswith(REMOVED_IMAGE_PREFIX):
-            removedImage = os.path.join(os.path.dirname(imageDir), newImgUUID)
-            os.rename(imageDir, removedImage)
-        else:
-            self.log.warning("Image %s in domain %s already renamed", imgUUID, 
sdUUID)
-
-        volumes = [volclass(self.repoPath, sdUUID, newImgUUID, volUUID) for 
volUUID in uuidlist]
-        for vol in volumes:
-            if not vol.volUUID.startswith(REMOVED_IMAGE_PREFIX):
-                vol.rename(self.deletedVolumeName(vol.volUUID), recovery=False)
-            else:
-                self.log.warning("Volume %s of image %s already renamed", 
vol.volUUID, imgUUID)
-            # We change image UUID in metadata
-            # (and IU_ LV tag for block volumes) of all volumes in image
-            vol.setImage(newImgUUID)
-
-        return newImgUUID
-
     def __chainSizeCalc(self, sdUUID, imgUUID, volUUID, size):
         """
         Compute an estimate of the whole chain size
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 0ade40d..115f575 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1942,10 +1942,6 @@
             except:
                 self.log.warning("SP %s SD %s img %s Vol %s - teardown failed")
 
-    def preDeleteRename(self, sdUUID, imgUUID):
-        repoPath = os.path.join(self.storage_repository, self.spUUID)
-        return image.Image(repoPath).preDeleteRename(sdUUID, imgUUID)
-
     def validateVolumeChain(self, sdUUID, imgUUID):
         repoPath = os.path.join(self.storage_repository, self.spUUID)
         image.Image(repoPath).validateVolumeChain(sdUUID, imgUUID)


--
To view, visit http://gerrit.ovirt.org/8508
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2452594c701eb9c3ccbab7de92e8fca69f033074
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

Reply via email to