Change in vdsm[master]: getAllTasksList\Status with spUUID retrieves info only if ho...

abaron at redhat.com abaron at redhat.com
Sun Jun 2 13:02:41 UTC 2013


Ayal Baron has posted comments on this change.

Change subject: getAllTasksList\Status with spUUID retrieves info only if host is the SPM
......................................................................


Patch Set 21: I would prefer that you didn't submit this

(4 inline comments)

....................................................
File vdsm/storage/sp.py
Line 2103:         sdCache.produce(sdUUID).extend(devlist, force)
Line 2104: 
Line 2105:     def getAllTasksStatuses(self):
Line 2106:         if self.lock.acquire(blocking=False):
Line 2107:             if self.spmRole == SPM_ACQUIRED:
above is redundant.  The moment the function is in this module this check is done automatically.
Line 2108:                 try:
Line 2109:                     tasksStatuses = self.taskMnr.getAllTasksStatuses("spm")
Line 2110:                     return tasksStatuses
Line 2111:                 except:


Line 2105:     def getAllTasksStatuses(self):
Line 2106:         if self.lock.acquire(blocking=False):
Line 2107:             if self.spmRole == SPM_ACQUIRED:
Line 2108:                 try:
Line 2109:                     tasksStatuses = self.taskMnr.getAllTasksStatuses("spm")
Did you ever run this code before submitting it? taskMnr ?

why not directly return? (without placing in tasksStatuses)
Line 2110:                     return tasksStatuses
Line 2111:                 except:
Line 2112:                     raise
Line 2113:                 finally:


Line 2108:                 try:
Line 2109:                     tasksStatuses = self.taskMnr.getAllTasksStatuses("spm")
Line 2110:                     return tasksStatuses
Line 2111:                 except:
Line 2112:                     raise
redundant
Line 2113:                 finally:
Line 2114:                     self.lock.release()
Line 2115:             self.lock.release()
Line 2116:         raise se.SpmStatusError(self.spUUID)


Line 2112:                     raise
Line 2113:                 finally:
Line 2114:                     self.lock.release()
Line 2115:             self.lock.release()
Line 2116:         raise se.SpmStatusError(self.spUUID)
this entire function should have been a single line of code:

return self.taskMng.getAllTasksStatuses("spm")
Line 2117: 
Line 2118:     def getAllTasksInfo(self):
Line 2119:         if self.lock.acquire(blocking=False):
Line 2120:             if self.spmRole == SPM_ACQUIRED:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4cbc11c924f0bd078749fea26d79b39c0dd48094
Gerrit-PatchSet: 21
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Barak Azulay <bazulay at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Daniel P. Berrange <berrange at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Shu Ming <shuming at linux.vnet.ibm.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: liron aravot <liron.aravot at gmail.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list