Change in vdsm[master]: clientIF: prepareVolumePath payload cleanup
fromani at redhat.com
fromani at redhat.com
Tue Mar 18 16:18:40 UTC 2014
Francesco Romani has posted comments on this change.
Change subject: clientIF: prepareVolumePath payload cleanup
......................................................................
Patch Set 2:
(4 comments)
http://gerrit.ovirt.org/#/c/24636/2/vdsm/clientIF.py
File vdsm/clientIF.py:
Line 297: elif (params.get('path', '') == '' and
Line 298: # line above can be removed in future, when < 3.3 engine
Line 299: # is not supported
Line 300: drive.get('path', '') == ''):
Line 301: volPath = ''
> Please add test for this case.
Nir: I believe this path is already covered by existing tests. I'll add the else clause as Dan suggested only for greater clarity.
Line 302:
Line 303: elif "path" in drive:
Line 304: volPath = drive['path']
Line 305:
Line 297: elif (params.get('path', '') == '' and
Line 298: # line above can be removed in future, when < 3.3 engine
Line 299: # is not supported
Line 300: drive.get('path', '') == ''):
Line 301: volPath = ''
> do we intentionally fall out of the inner condition silently? if so, add
Yes we intentionally fall out of the inner condition, so I'll add an
else:
pass
clause.
This case is handled by the base value set in line 290 above; then the code just looks if it should be overridden or not.
Line 302:
Line 303: elif "path" in drive:
Line 304: volPath = drive['path']
Line 305:
Line 339:
> I guess the single quote slipped just in here. Not that this would a biggie
Will fix
Line 338: # This is so generic because supervdsm.ProxyCaller wraps a
Line 339: # multiprocessing' RemoteError into a RuntimeError.
Line 340: raise vm.VolumeError("Supervdsm call failed for %s in "
Line 341: "drive: %s" % (device, drive))
Line 342:
> I find the following implementation of the function much simpler, functiona
Agree. Will fix the way you suggested.
Line 343: return mkFsFunction(vmId, payload['file'], payload.get('volId'))
Line 344:
Line 345: def teardownVolumePath(self, drive):
Line 346: res = {'status': doneCode}
--
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: 2
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: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list