Change in vdsm[master]: clientIF: prepareVolumePath payload cleanup

asegurap at redhat.com asegurap at redhat.com
Wed Mar 19 08:29:40 UTC 2014


Antoni Segura Puimedon has posted comments on this change.

Change subject: clientIF: prepareVolumePath payload cleanup
......................................................................


Patch Set 3:

(2 comments)

Some minor nits.

http://gerrit.ovirt.org/#/c/24636/3/vdsm/clientIF.py
File vdsm/clientIF.py:

Line 288:                 # caution: this code is tricky. See for example:
Line 289:                 # https://bugzilla.redhat.com/show_bug.cgi?id=1047356
Line 290:                 params = drive['specParams']
Line 291:                 if 'vmPayload' in params:
Line 292:                     payload = params['vmPayload']  # shortcut
This shortcut is not winning us much. If we don't use some shortcut at least twice we generally don't define such short cuts.
Line 293:                     volPath = self._prepareVolumeFromPayload(vmId, device,
Line 294:                                                              payload)
Line 295:                 # better explicit than implicit, thus leave path == ''
Line 296:                 # for empty cdrom and floppy drives.


Line 324:         return volPath
Line 325: 
Line 326:     def _prepareVolumeFromPayload(self, vmId, device, payload):
Line 327:         """
Line 328:         vmPayload is a key in params
I believe 'params' should be in the docstring 'specParams' as that is the name which refers to this entity in the API. It makes it more readable IMHO.
Line 329:         'vmPayload': {'volId': 'volume id',   # volId is optional
Line 330:                       'file': {'filename': 'content', ...}}
Line 331:         """
Line 332:         if device == 'cdrom':


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I058206b7506ddbb5ec087c9ea0963a10ed57affb
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Martin Polednik <mpoledni at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list