Change in vdsm[master]: BZ#840594 Fix netinfo when libvirt bridge does not exist.
danken at redhat.com
danken at redhat.com
Tue Aug 14 09:27:55 UTC 2012
Dan Kenigsberg has posted comments on this change.
Change subject: BZ#840594 Fix netinfo when libvirt bridge does not exist.
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(2 inline comments)
....................................................
File vdsm/netinfo.py
Line 242: nets = networks()
Line 243: for netname in nets.iterkeys():
Line 244: if nets[netname]['bridged']:
Line 245: try:
Line 246: devname = netname
this assignment should certainly go out of the try-block
Line 247: d['networks'][netname] = { 'ports': ports(devname),
Line 248: 'stp': bridge_stp_state(devname),
Line 249: 'cfg': getIfaceCfg(devname), }
Line 250: except OSError, e:
Line 253: # added d['networks']
Line 254: if e == errno.ENOENT:
Line 255: continue
Line 256: else:
Line 257: raise
Toni, you are correct about Python-ness, however, swallowing the exception is not recommended. Could you log the error (and its trace back?) notice that the try-except block contains more than just the ports() function - other things may fail, and when they do, I'd like to know that.
if the log proves too dirty and too common, we can later remove the traceback.
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 at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky at redhat.com>
Gerrit-Reviewer: Livnat Peer <lpeer at redhat.com>
More information about the vdsm-patches
mailing list