Change in vdsm[master]: fileVolumeManifest: Make lease and meta path getters public
alitke at redhat.com
alitke at redhat.com
Wed Dec 23 21:48:24 UTC 2015
Adam Litke has uploaded a new change for review.
Change subject: fileVolumeManifest: Make lease and meta path getters public
......................................................................
fileVolumeManifest: Make lease and meta path getters public
Change-Id: I04885afca49df8792d849694ed358512fa1304ba
Signed-off-by: Adam Litke <alitke at redhat.com>
---
M vdsm/storage/fileVolume.py
1 file changed, 11 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/36/51036/1
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index 9eb0173..db2d7ec 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -78,7 +78,7 @@
self._imagePath = imageDir
@classmethod
- def _metaVolumePath(cls, volPath):
+ def metaVolumePath(cls, volPath):
if volPath:
return volPath + META_FILEEXT
else:
@@ -90,7 +90,7 @@
"""
if not vol_path:
vol_path = self.getVolumePath()
- return self._metaVolumePath(vol_path)
+ return self.metaVolumePath(vol_path)
def validateMetaVolumePath(self):
"""
@@ -239,7 +239,7 @@
@classmethod
def _putMetadata(cls, metaId, meta):
volPath, = metaId
- metaPath = cls._metaVolumePath(volPath)
+ metaPath = cls.metaVolumePath(volPath)
data = cls.formatMetadata(meta)
@@ -265,7 +265,7 @@
self.oop.os.unlink(metaPath)
@classmethod
- def _leaseVolumePath(cls, vol_path):
+ def leaseVolumePath(cls, vol_path):
if vol_path:
return vol_path + LEASE_FILEEXT
else:
@@ -276,7 +276,7 @@
cls.log.debug("Initializing volume lease volUUID=%s sdUUID=%s, "
"metaId=%s", volUUID, sdUUID, metaId)
volPath, = metaId
- leasePath = cls._leaseVolumePath(volPath)
+ leasePath = cls.leaseVolumePath(volPath)
oop.getProcessPool(sdUUID).truncateFile(leasePath, LEASE_FILEOFFSET)
cls.file_setrw(leasePath, rw=True)
sanlock.init_resource(sdUUID, volUUID, [(leasePath,
@@ -288,7 +288,7 @@
"""
if not vol_path:
vol_path = self.getVolumePath()
- return self._leaseVolumePath(vol_path)
+ return self.leaseVolumePath(vol_path)
def _shareLease(self, dstImgPath):
"""
@@ -368,7 +368,7 @@
raise TypeError("halfbakedVolumeRollback takes 1 or 3 "
"arguments (%d given)" % len(args))
- metaVolPath = cls.metadataClass._metaVolumePath(volPath)
+ metaVolPath = cls.metadataClass.metaVolumePath(volPath)
cls.log.info("Halfbaked volume rollback for volPath=%s", volPath)
if oop.getProcessPool(sdUUID).fileUtils.pathExists(volPath) and not \
@@ -378,7 +378,7 @@
@classmethod
def createVolumeMetadataRollback(cls, taskObj, volPath):
cls.log.info("createVolumeMetadataRollback: volPath=%s" % (volPath))
- metaPath = cls.metadataClass._metaVolumePath(volPath)
+ metaPath = cls.metadataClass.metaVolumePath(volPath)
sdUUID = getDomUuidFromVolumePath(volPath)
if oop.getProcessPool(sdUUID).os.path.lexists(metaPath):
oop.getProcessPool(sdUUID).os.unlink(metaPath)
@@ -447,7 +447,7 @@
self.log.info("Request to delete volume %s", self.volUUID)
vol_path = self.getVolumePath()
- lease_path = self._md._leaseVolumePath(vol_path)
+ lease_path = self._md.leaseVolumePath(vol_path)
if not force:
self._md.validateDelete()
@@ -495,8 +495,8 @@
cls.log.info("Volume rollback for volPath=%s", volPath)
procPool = oop.getProcessPool(getDomUuidFromVolumePath(volPath))
procPool.utils.rmFile(volPath)
- procPool.utils.rmFile(cls.metadataClass._metaVolumePath(volPath))
- procPool.utils.rmFile(cls.metadataClass._leaseVolumePath(volPath))
+ procPool.utils.rmFile(cls.metadataClass.metaVolumePath(volPath))
+ procPool.utils.rmFile(cls.metadataClass.leaseVolumePath(volPath))
def llPrepare(self, rw=False, setrw=False):
"""
--
To view, visit https://gerrit.ovirt.org/51036
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I04885afca49df8792d849694ed358512fa1304ba
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>
More information about the vdsm-patches
mailing list