New patch submitted by Eduardo Warszawski (ewarszaw@redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/640
commit a609d198d38137374db72a7ac3fc416c36ad64d3 Author: Eduardo Warszawski ewarszaw@redhat.com Date: Thu Jun 30 16:07:58 2011 +0300
BZ#717658 - Change format signature.
Change-Id: Iea1e5735563087195181c625e57b8ba8e75d3441
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py index 214e8a4..5c8f8e2 100644 --- a/vdsm/storage/blockSD.py +++ b/vdsm/storage/blockSD.py @@ -658,11 +658,12 @@ class BlockStorageDomain(sd.StorageDomain): fileUtils.cleanupdir(os.path.join("/dev", self.sdUUID))
@classmethod - def format(cls, sdUUID, domaindir): + def format(cls, sdUUID): """Format detached storage domain. This removes all data from the storage domain. """ # Remove the directory tree + domaindir = cls.findDomainPath(sdUUID) fileUtils.cleanupdir(domaindir, ignoreErrors = True) # Remove special metadata and service volumes # Remove all volumes LV if exists diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py index 8b40a59..023c197 100644 --- a/vdsm/storage/fileSD.py +++ b/vdsm/storage/fileSD.py @@ -195,12 +195,13 @@ class FileStorageDomain(sd.StorageDomain): return imgList
@classmethod - def format(cls, sdUUID, domaindir): + def format(cls, sdUUID): """ Format detached storage domain. This removes all data from the storage domain. """ cls.log.info("Formating domain %s", sdUUID) + domaindir = cls.findDomainPath(sdUUID) processPoolDict[sdUUID].fileUtils.cleanupdir(domaindir, ignoreErrors = False) return True
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py index 325da5d..579b282 100644 --- a/vdsm/storage/sd.py +++ b/vdsm/storage/sd.py @@ -552,14 +552,6 @@ class StorageDomain: if self.isBackup(): self.unmountMaster()
- - def format(self): - """ - Format detached storage domain. - This removes all data from the storage domain. - """ - pass - def getAllImages(self): """ Fetch the list of the Image UUIDs diff --git a/vdsm/storage/sdf.py b/vdsm/storage/sdf.py index da8335c..16faa3e 100644 --- a/vdsm/storage/sdf.py +++ b/vdsm/storage/sdf.py @@ -81,13 +81,13 @@ class StorageDomainFactory:
for domClass in (blockSD.BlockStorageDomain, nfsSD.NfsStorageDomain, localFsSD.LocalFsStorageDomain): try: - domaindir = domClass.findDomainPath(sdUUID) + domClass.findDomainPath(sdUUID) except (se.StorageDomainDoesNotExist): pass except Exception: cls.log.error("Can't find out domain %s", sdUUID, exc_info=True) else: - return domClass.format(sdUUID, domaindir) + return domClass.format(sdUUID)
raise se.StorageDomainTypeError(sdUUID)
New patch submitted by Eduardo Warszawski (ewarszaw@redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/640
commit 33f2b8cc81c462ce183ff42c5ca2fa29db16ba2a Author: Eduardo Warszawski ewarszaw@redhat.com Date: Thu Jun 30 16:07:58 2011 +0300
BZ#717658 - Change format signature.
Change-Id: Iea1e5735563087195181c625e57b8ba8e75d3441
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py index 3a1975f..df37019 100644 --- a/vdsm/storage/blockSD.py +++ b/vdsm/storage/blockSD.py @@ -697,12 +697,17 @@ class BlockStorageDomain(sd.StorageDomain): fileUtils.cleanupdir(os.path.join("/dev", self.sdUUID))
@classmethod - def format(cls, sdUUID, domaindir): + def format(cls, sdUUID): """Format detached storage domain. This removes all data from the storage domain. """ # Remove the directory tree - fileUtils.cleanupdir(domaindir, ignoreErrors = True) + try: + domaindir = cls.findDomainPath(sdUUID) + except (se.StorageDomainDoesNotExist): + pass + else: + fileUtils.cleanupdir(domaindir, ignoreErrors = True) # Remove special metadata and service volumes # Remove all volumes LV if exists _removeVMSfs(lvm.lvPath(sdUUID, MASTERLV)) diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py index 35f7ab3..8015926 100644 --- a/vdsm/storage/fileSD.py +++ b/vdsm/storage/fileSD.py @@ -212,13 +212,18 @@ class FileStorageDomain(sd.StorageDomain): return imgList
@classmethod - def format(cls, sdUUID, domaindir): + def format(cls, sdUUID): """ Format detached storage domain. This removes all data from the storage domain. """ cls.log.info("Formating domain %s", sdUUID) - oop.getProcessPool(sdUUID).fileUtils.cleanupdir(domaindir, ignoreErrors = False) + try: + domaindir = cls.findDomainPath(sdUUID) + except (se.StorageDomainDoesNotExist): + pass + else: + oop.getProcessPool(sdUUID).fileUtils.cleanupdir(domaindir, ignoreErrors = False) return True
def getRemotePath(self): diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py index fd915a0..562982c 100644 --- a/vdsm/storage/sd.py +++ b/vdsm/storage/sd.py @@ -535,13 +535,6 @@ class StorageDomain: self.mountMaster() self.createMasterTree()
- def format(self): - """ - Format detached storage domain. - This removes all data from the storage domain. - """ - pass - def getAllImages(self): """ Fetch the list of the Image UUIDs diff --git a/vdsm/storage/sdf.py b/vdsm/storage/sdf.py index 2e2126d..f13c933 100644 --- a/vdsm/storage/sdf.py +++ b/vdsm/storage/sdf.py @@ -91,14 +91,7 @@ class StorageDomainFactory: cls.log.warn("Storage domain %s doesn't exist. Trying recycle leftovers ...", sdUUID)
for domClass in (blockSD.BlockStorageDomain, nfsSD.NfsStorageDomain, localFsSD.LocalFsStorageDomain): - try: - domaindir = domClass.findDomainPath(sdUUID) - except (se.StorageDomainDoesNotExist): - pass - except Exception: - cls.log.error("Can't find out domain %s", sdUUID, exc_info=True) - else: - return domClass.format(sdUUID, domaindir) + return domClass.format(sdUUID)
raise se.StorageDomainTypeError(sdUUID)
Yotam Oron has posted comments on this change.
Change subject: BZ#717658 - Change format signature. ......................................................................
Patch Set 2: I would prefer that you didn't submit this
(2 inline comments)
.................................................... File vdsm/storage/blockSD.py Line 706: domaindir = cls.findDomainPath(sdUUID) Line 707: except (se.StorageDomainDoesNotExist): Line 708: pass Line 709: else: Line 710: fileUtils.cleanupdir(domaindir, ignoreErrors = True) Convention disctates ignoreErrors=True Line 711: # Remove special metadata and service volumes Line 712: # Remove all volumes LV if exists Line 713: _removeVMSfs(lvm.lvPath(sdUUID, MASTERLV)) Line 714: try:
.................................................... File vdsm/storage/fileSD.py Line 219: """ Line 220: cls.log.info("Formating domain %s", sdUUID) Line 221: try: Line 222: domaindir = cls.findDomainPath(sdUUID) Line 223: except (se.StorageDomainDoesNotExist): Is this the only exception thrown (old implementation also caught Exception) ? Line 224: pass Line 225: else: Line 226: oop.getProcessPool(sdUUID).fileUtils.cleanupdir(domaindir, ignoreErrors = False) Line 227: return True
-- To view, visit http://gerrit.usersys.redhat.com/640 To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iea1e5735563087195181c625e57b8ba8e75d3441 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: Change format signature in order to simplify SD recycle. ......................................................................
Patch Set 3: Looks good to me, approved
-- To view, visit http://gerrit.usersys.redhat.com/640 To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iea1e5735563087195181c625e57b8ba8e75d3441 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: Change format signature in order to simplify SD recycle. ......................................................................
Patch Set 4: Verified; Looks good to me, approved
-- Gerrit-MessageType: comment Gerrit-Change-Id: Iea1e5735563087195181c625e57b8ba8e75d3441 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Change format signature in order to simplify SD recycle. ......................................................................
Change format signature in order to simplify SD recycle.
Needed for remove the sdf.py
Change-Id: Iea1e5735563087195181c625e57b8ba8e75d3441 --- M vdsm/storage/blockSD.py M vdsm/storage/fileSD.py M vdsm/storage/sd.py M vdsm/storage/sdf.py 4 files changed, 15 insertions(+), 19 deletions(-)
Approvals: Dan Kenigsberg: Verified; Looks good to me, approved
-- Gerrit-MessageType: merged Gerrit-Change-Id: Iea1e5735563087195181c625e57b8ba8e75d3441 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: Change format signature in order to simplify SD recycle. ......................................................................
-- Gerrit-MessageType: comment Gerrit-Change-Id: Iea1e5735563087195181c625e57b8ba8e75d3441 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
vdsm-patches@lists.fedorahosted.org