Dan Kenigsberg has posted comments on this change.
Change subject: vm payload: add file injection to vm ......................................................................
Patch Set 7: (4 inline comments)
.................................................... File vdsm/constants.py.in Line 54: P_PAYLOAD_PREFIX = '/var/run/vdsm/payload/' Please do not add this very specific constant to the global file. It should be defined internally in mkimage module.
Also, it should *refer* to P_VDSM_RUN, not copy its default content.
.................................................... File vdsm/mkimage.py Line 46: dirname = tempfile.mkdtemp(prefix=P_PAYLOAD_PREFIX) test-and-sometime-later-create is a bad practice:
if not os.path.exists(P_PAYLOAD_PREFIX): os.mkdir(P_PAYLOAD_PREFIX)
another thread may create the directory after you check for its existence. Now, this is not very probable. It is simply bad practice.
Line 81: for file in os.listdir(dirname): no need to mount in _decodeFilesInDir, of course.
I'm suggesting to add a target directory argument to decodeFilesInDir. the floppy use case would pass the mountpoint, and the iso use case would pass a tempdir it just created.
Line 103: _commonCleanFs(files, dirname, isopath) just like the "finally" of line 88.
finally does not swallow exceptions, it lets them pass through.
-- To view, visit http://gerrit.ovirt.org/2321 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I256475342c79690a95ad999335522f99714cdc8b Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Shahar Havivi shavivi@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Ewoud Kohl van Wijngaarden ewoud@kohlvanwijngaarden.nl Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Shahar Havivi shavivi@redhat.com