Change in vdsm[master]: Move hsm.validatePoolSD() -> pool.validatePoolSD().
ewarszaw at redhat.com
ewarszaw at redhat.com
Sun Dec 9 10:52:32 UTC 2012
Eduardo has posted comments on this change.
Change subject: Move hsm.validatePoolSD() -> pool.validatePoolSD().
......................................................................
Patch Set 2: (3 inline comments)
....................................................
File vdsm/storage/hsm.py
Line 1243: #getExclusiveLock(vmList...)
Line 1244: pool = self.getPool(spUUID)
Line 1245: if sdUUID and sdUUID != sd.BLANK_UUID:
Line 1246: pool.validatePoolSD(sdUUID)
Line 1247: self.validateSdUUID(sdUUID)
You are right but this will change the order of the exception thrown and we want to mantain BC.
Line 1248: pool.removeVM(vmUUID=vmUUID, sdUUID=sdUUID)
Line 1249:
Line 1250: @public
Line 1251: def getVmsList(self, spUUID, sdUUID=None, options=None):
....................................................
File vdsm/storage/sp.py
Line 456: def getMasterVersion(self):
Line 457: return self.getMetaParam(PMDK_MASTER_VER)
Line 458:
Line 459: # TODO: Remove or rename this function.
Line 460: def validatePoolSD(self, sdUUID):
Again you are right. Validate is not only abused but the validateXXX functions are in general wrong. This in particular deserves a better name or to be removed, as stated in the comment.
This function checks a "double" condintion then is difficult to name it correctly (and points the issue): Is the SD listed in the pool metadata? Is the SD part of the pool (pool UUID in the SD metadata)?
Meanwhile I preserved the old name.
Line 461: if sdUUID not in self.getDomains():
Line 462: raise se.StorageDomainNotMemberOfPool(self.spUUID, sdUUID)
Line 463: return True
Line 464:
Line 456: def getMasterVersion(self):
Line 457: return self.getMetaParam(PMDK_MASTER_VER)
Line 458:
Line 459: # TODO: Remove or rename this function.
Line 460: def validatePoolSD(self, sdUUID):
This function does not changes MD.
Line 461: if sdUUID not in self.getDomains():
Line 462: raise se.StorageDomainNotMemberOfPool(self.spUUID, sdUUID)
Line 463: return True
Line 464:
--
To view, visit http://gerrit.ovirt.org/9455
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3ba16c8a427c9478ae81c2693d79b8bd601f1ec3
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Royce Lv <lvroyce at linux.vnet.ibm.com>
Gerrit-Reviewer: Shu Ming <shuming at linux.vnet.ibm.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list