Nir Soffer has uploaded a new change for review.
Change subject: sp: Fix domain.produceVolume calling convention ......................................................................
sp: Fix domain.produceVolume calling convention
As a general rule positional args should be called as positional args (arg), and kwargs as kwargs (arg=value). In some cases using kwarg call style for positional argument makes the code more clear, but not in the case of domain.procudeVolume.
Change-Id: Id804b4754507f1c6bf4e85f006f6db6fdda2e330 Signed-off-by: Nir Soffer nsoffer@redhat.com --- M vdsm/storage/sp.py 1 file changed, 3 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/65046/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py index 2e50a98..759ea00 100644 --- a/vdsm/storage/sp.py +++ b/vdsm/storage/sp.py @@ -1848,8 +1848,7 @@
if imgUUID != srcImgUUID and srcImgUUID != sc.BLANK_UUID: srcDom = sdCache.produce(sdUUID) - srcVol = srcDom.produceVolume(imgUUID=srcImgUUID, - volUUID=srcVolUUID) + srcVol = srcDom.produceVolume(srcImgUUID, srcVolUUID)
if not srcVol.isShared(): if srcVol.getParent() == sc.BLANK_UUID: @@ -1943,16 +1942,14 @@ img_ns = sd.getNamespace(sc.IMAGE_NAMESPACE, sdUUID) with rm.acquireResource(img_ns, imgUUID, rm.EXCLUSIVE): sdCache.produce(sdUUID).produceVolume( - imgUUID=imgUUID, - volUUID=volUUID).setDescription(descr=description) + imgUUID, volUUID).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=imgUUID, - volUUID=volUUID).setLegality(legality=legality) + imgUUID, volUUID).setLegality(legality=legality)
def getVmsList(self, sdUUID): self.validatePoolSD(sdUUID)
gerrit-hooks has posted comments on this change.
Change subject: sp: Fix domain.produceVolume calling convention ......................................................................
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: Fix domain.produceVolume calling convention ......................................................................
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: Fix domain.produceVolume calling convention ......................................................................
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: Fix domain.produceVolume calling convention ......................................................................
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: Fix domain.produceVolume calling convention ......................................................................
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: Fix domain.produceVolume calling convention ......................................................................
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: Fix domain.produceVolume calling convention ......................................................................
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: Fix domain.produceVolume calling convention ......................................................................
Patch Set 7: Verified+1
Nir Soffer has posted comments on this change.
Change subject: sp: Fix domain.produceVolume calling convention ......................................................................
Patch Set 7: Continuous-Integration+1
Test failures not relevant.
gerrit-hooks has posted comments on this change.
Change subject: sp: Fix domain.produceVolume calling convention ......................................................................
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: Fix domain.produceVolume calling convention ......................................................................
Patch Set 8: Code-Review+1
gerrit-hooks has posted comments on this change.
Change subject: sp: Fix domain.produceVolume calling convention ......................................................................
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: Fix domain.produceVolume calling convention ......................................................................
Patch Set 9: Code-Review+2
Nir Soffer has submitted this change and it was merged.
Change subject: sp: Fix domain.produceVolume calling convention ......................................................................
sp: Fix domain.produceVolume calling convention
As a general rule positional args should be called as positional args (arg), and kwargs as kwargs (arg=value). In some cases using kwarg call style for positional argument makes the code more clear, but not in the case of domain.produceVolume.
Change-Id: Id804b4754507f1c6bf4e85f006f6db6fdda2e330 Signed-off-by: Nir Soffer nsoffer@redhat.com Reviewed-on: https://gerrit.ovirt.org/65046 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, 3 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: Fix domain.produceVolume calling convention ......................................................................
Patch Set 10:
* Update tracker: IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org