Dan Kenigsberg has posted comments on this change.
Change subject: netinfo: implement functions gathering ipv6 information
......................................................................
Patch Set 3: I would prefer that you didn't submit this
(3 inline comments)
sorry for the delayed review, I've missed your fixed version. minor comments
within.
....................................................
File tests/netinfoTests.py
Line 60: for n, addr in zip(num, ip):
Line 61: self.assertEqual(addr, netinfo.intToAddress(n))
Line 62:
Line 63: def testIPv6StrToAddress(self):
Line 64: strings = [
it's only a little test, so this could fly, but "strings" is a very general a
vague name for a variable. (not that I have a better name ready)
Line 65: '00000000000000000000000000000000',
Line 66: '00000000000000000000000000000001',
Line 67: '20010db8000000000001000000000002',
Line 68: '20010db8aaaabbbbccccddddeeeeffff',
....................................................
File vdsm/netinfo.py
Line 181:
Line 182:
Line 183: def getipv6addrs(dev):
Line 184: """Return a list of ipv6 addresses in the format of
'address/prefixlen'."""
Line 185: dev_info_list = ethtool.get_interfaces_info(dev.encode('utf8'))
I was asking about the address scope because I do not know much about it.
please verify that indeed the scope can be deduced from the address.
Line 186: ipv6addrs = dev_info_list[0].get_ipv6_addresses()
Line 187: return ['/'.join([addr.address, str(addr.netmask)]) for addr in
ipv6addrs]
Line 188:
Line 189:
Line 183: def getipv6addrs(dev):
Line 184: """Return a list of ipv6 addresses in the format of
'address/prefixlen'."""
Line 185: dev_info_list = ethtool.get_interfaces_info(dev.encode('utf8'))
Line 186: ipv6addrs = dev_info_list[0].get_ipv6_addresses()
Line 187: return ['/'.join([addr.address, str(addr.netmask)]) for addr in
ipv6addrs]
I find it awkward to use join() with a two-item list.
addr.address + '/' + str(addr.netmask)
is simpler imo.
Line 188:
Line 189:
Line 190: def gethwaddr(dev):
Line 191: return file('/sys/class/net/%s/address' % dev).read().strip()
--
To view, visit http://gerrit.ovirt.org/9381
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2318ffa7d71abe3f57cb5e480bc46565e29f3894
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Hunt Xu <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Hunt Xu <[email protected]>
Gerrit-Reviewer: Livnat Peer <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches