Change in vdsm[master]: netinfo: optimize ipaddr retrieval
danken at redhat.com
danken at redhat.com
Thu Feb 6 18:16:20 UTC 2014
Dan Kenigsberg has posted comments on this change.
Change subject: netinfo: optimize ipaddr retrieval
......................................................................
Patch Set 3:
(2 comments)
http://gerrit.ovirt.org/#/c/23518/3/lib/vdsm/netinfo.py
File lib/vdsm/netinfo.py:
Line 297:
Line 298: def prefix2netmask(prefix):
Line 299: if not 0 <= prefix <= 32:
Line 300: raise ValueError('%s is not a valid prefix value. It must be between '
Line 301: '0 and 32' % prefix)
correct - but unrelated.
Line 302: return socket.inet_ntoa(
Line 303: struct.pack("!I", int('1' * prefix + '0' * (32 - prefix), 2)))
Line 304:
Line 305:
Line 637: gateways = getRoutes()
Line 638: ipv6routes = getIPv6Routes()
Line 639: paddr = permAddr()
Line 640: dhcp4 = getDhclientIfaces(_DHCLIENT_LEASES_GLOBS)
Line 641: ipAddrs = _getIpAddrs()
maybe keeping the naming convention of the other caches above ("ipaddrs") would make this a bit more streamlined.
Line 642:
Line 643: for net, netAttr in networks().iteritems():
Line 644: try:
Line 645: d['networks'][net] = _getNetInfo(netAttr.get('iface', net),
--
To view, visit http://gerrit.ovirt.org/23518
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I571529f6dd379ffb317625fd9e2abd6b5ae88696
Gerrit-PatchSet: 3
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: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list