Antoni Segura Puimedon has posted comments on this change.
Change subject: BZ#840594 Fix netinfo when libvirt bridge does not exist. ......................................................................
Patch Set 1: (1 inline comment)
.................................................... File vdsm/netinfo.py Line 253: # added d['networks'] Line 254: if e == errno.ENOENT: Line 255: continue Line 256: else: Line 257: raise It is a case of "It is easier to ask for forgiveness than permission". http://docs.python.org/glossary.html#term-eafp http://en.wikipedia.org/wiki/Python_syntax_and_semantics#Exceptions
The usual Python style would be to put it in the way I did (in contrast to the Java style).
As for performance, it depends if the exceptional case is very common, i.e., how likely it is for a call to this method to happen when the user to has manually modified a bridge vs. no manual modification has happened. Line 258: else: Line 259: devname = nets[netname]['iface'] Line 260: d['networks'][netname] = {} Line 261:
-- To view, visit http://gerrit.ovirt.org/7127 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2538a8ce2fafd8efed834b87b20a63d058afd96b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com