Change in vdsm[master]: Optimize netinfo.networks.

danken at redhat.com danken at redhat.com
Sun Mar 24 08:19:43 UTC 2013


Dan Kenigsberg has posted comments on this change.

Change subject: Optimize netinfo.networks.
......................................................................


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

(2 inline comments)

....................................................
File vdsm/netinfo.py
Line 89:               'red': { 'iface': 'red', 'bridged': False } }
Line 90:     """
Line 91:     nets = {}
Line 92:     conn = libvirtconnection.get()
Line 93:     allNets = ((net, net.name()) for net in conn.listAllNetworks(0))
"net" is used for two different things here: the network object, and the tuple containing an object and its name. too confusing for me.
Line 94:     vdsmNets = ((net[0],
Line 95:                  net[1][len(LIBVIRT_NET_PREFIX):])
Line 96:                 for net in allNets if net[1].startswith(LIBVIRT_NET_PREFIX))
Line 97:     for net, netname in vdsmNets:


Line 91:     nets = {}
Line 92:     conn = libvirtconnection.get()
Line 93:     allNets = ((net, net.name()) for net in conn.listAllNetworks(0))
Line 94:     vdsmNets = ((net[0],
Line 95:                  net[1][len(LIBVIRT_NET_PREFIX):])
I'm not sure that the original removal of LIBVIRT_NET_PREFIX wasn't more readable (as much as I love comprehensions).
Line 96:                 for net in allNets if net[1].startswith(LIBVIRT_NET_PREFIX))
Line 97:     for net, netname in vdsmNets:
Line 98:         nets[netname] = {}
Line 99:         xml = minidom.parseString(net.XMLDesc(0))


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2cd332819363c4399335358686e19d6a1dc3b45e
Gerrit-PatchSet: 2
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: Jarod.w <work.iec23801 at gmail.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list