Nir Soffer has uploaded a new change for review.
Change subject: sp: Streamline calls to volume methods ......................................................................
sp: Streamline calls to volume methods
When calling volume methods, we typically produce the domain, produce the volume, and calling the method. Adding a temporary variable for the volume makes the code easier to read.
Change-Id: I8bbdfbd5cf6a4a7345c350359e76c2156720c683 Signed-off-by: Nir Soffer nsoffer@redhat.com --- M vdsm/storage/sp.py 1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/65047/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py index 759ea00..78562c9 100644 --- a/vdsm/storage/sp.py +++ b/vdsm/storage/sp.py @@ -1891,8 +1891,8 @@ with rm.acquireResource(img_ns, imgUUID, rm.EXCLUSIVE): dom = sdCache.produce(sdUUID) for volUUID in volumes: - dom.produceVolume(imgUUID, volUUID).delete( - postZero=postZero, force=force) + vol = dom.produceVolume(imgUUID, volUUID) + vol.delete(postZero=postZero, force=force)
def purgeImage(self, sdUUID, imgUUID, volsByImg): """ @@ -1941,15 +1941,15 @@ self.validatePoolSD(sdUUID) img_ns = sd.getNamespace(sc.IMAGE_NAMESPACE, sdUUID) with rm.acquireResource(img_ns, imgUUID, rm.EXCLUSIVE): - sdCache.produce(sdUUID).produceVolume( - imgUUID, volUUID).setDescription(descr=description) + vol = sdCache.produce(sdUUID).produceVolume(imgUUID, volUUID) + vol.setDescription(descr=description)
def setVolumeLegality(self, sdUUID, imgUUID, volUUID, legality): self.validatePoolSD(sdUUID) img_ns = sd.getNamespace(sc.IMAGE_NAMESPACE, sdUUID) with rm.acquireResource(img_ns, imgUUID, rm.EXCLUSIVE): - sdCache.produce(sdUUID).produceVolume( - imgUUID, volUUID).setLegality(legality=legality) + vol = sdCache.produce(sdUUID).produceVolume(imgUUID, volUUID) + vol.setLegality(legality=legality)
def getVmsList(self, sdUUID): self.validatePoolSD(sdUUID)
gerrit-hooks has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 1:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
gerrit-hooks has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 2:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
gerrit-hooks has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 3:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
gerrit-hooks has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 4:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
gerrit-hooks has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 5:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
gerrit-hooks has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 6:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
gerrit-hooks has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 7:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Nir Soffer has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 7: Verified+1
gerrit-hooks has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 8:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Freddy Rolland has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 8: Code-Review+1
gerrit-hooks has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 9:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Adam Litke has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 9: Code-Review+2
Nir Soffer has submitted this change and it was merged.
Change subject: sp: Streamline calls to volume methods ......................................................................
sp: Streamline calls to volume methods
When calling volume methods, we typically produce the domain, produce the volume, and calling the method. Adding a temporary variable for the volume makes the code easier to read.
Change-Id: I8bbdfbd5cf6a4a7345c350359e76c2156720c683 Signed-off-by: Nir Soffer nsoffer@redhat.com Reviewed-on: https://gerrit.ovirt.org/65047 Reviewed-by: Freddy Rolland frolland@redhat.com Continuous-Integration: Jenkins CI Reviewed-by: Adam Litke alitke@redhat.com --- M vdsm/storage/sp.py 1 file changed, 6 insertions(+), 6 deletions(-)
Approvals: Adam Litke: Looks good to me, approved Nir Soffer: Verified Jenkins CI: Passed CI tests Freddy Rolland: Looks good to me, but someone else must approve
gerrit-hooks has posted comments on this change.
Change subject: sp: Streamline calls to volume methods ......................................................................
Patch Set 10:
* Update tracker: IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org