Change in vdsm[master]: [WIP] BZ#855924 fix VM config dictionary #2

danken at redhat.com danken at redhat.com
Wed Oct 17 09:02:46 UTC 2012


Dan Kenigsberg has posted comments on this change.

Change subject: [WIP] BZ#855924 fix VM config dictionary #2
......................................................................


Patch Set 1: I would prefer that you didn't submit this

(2 inline comments)

....................................................
File vdsm/vm.py
Line 237:                         try:
Line 238:                             # add cdrom and floppy as paths
Line 239:                             self._vm.conf[i] = [x['path'] for x in \
Line 240:                                 self._vm.conf['drives'] if x['device'] == i][0]
Line 241:                             # remove them from 'devices' list
the comment says 'device', the code says 'drives'. which is correct?

why are you defining a list here, and throwing it away?
as much as I love list comprehensions, I think they do not fit here.
Line 242:                             [self._vm.conf['drives'].pop(
Line 243:                                 self._vm.conf['drives'].index(z)) \
Line 244:                                 for z in [x for x in \
Line 245:                                 self._vm.conf['drives'] if x['device'] == i]]


Line 242:                             [self._vm.conf['drives'].pop(
Line 243:                                 self._vm.conf['drives'].index(z)) \
Line 244:                                 for z in [x for x in \
Line 245:                                 self._vm.conf['drives'] if x['device'] == i]]
Line 246:                         except:
now new catch-all try-blocks, please.
Line 247:                             pass
Line 248:                 if not mstate:
Line 249:                     self._vm.conf['_migrationParams'] = {'dst': self._dst,
Line 250:                                 'mode': self._mode, 'method': self._method,


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I33e957f8daac4266d9e19cc008cf830bd395ffff
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Peter V. Saveliev <peet at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>


More information about the vdsm-patches mailing list