Ido Barkan has posted comments on this change.
Change subject: netinfo: improve which ipv4 addr is reported.
......................................................................
Patch Set 9:
(4 comments)
https://gerrit.ovirt.org/#/c/33375/9/lib/vdsm/netinfo.py
File lib/vdsm/netinfo.py:
Line 322: return Route.fromText(output[0]) if output else None
Line 323:
Line 324:
Line 325: def getIpInfo(dev, ipaddrs=None, ipv4_gateway=None):
Line 326: """report IP addresses of a device. if there are multiple
primary IP
in every docstring we start sentences with a capital letter
Done
Line 327: addresses, report in ipv4addr the one that is in the same subnet of
Line 328: ipv4_gateway, if it is supplied."""
Line 329: # TODO: support same logic for ipv6
Line 330:
https://gerrit.ovirt.org/#/c/33375/9/lib/vdsm/netlink/addr.py
File lib/vdsm/netlink/addr.py:
Line 57: return data
Line 58:
Line 59:
Line 60: def split(addr):
Line 61: """split an addr dict from iter_addrs"""
typography again
Done
Line 62: # for 32bits address, the address field is slashless
Line 63: return addr['address'].split('/')[0],
addr['prefixlen']
Line 64:
Line 65:
https://gerrit.ovirt.org/#/c/33375/9/tests/netinfoTests.py
File tests/netinfoTests.py:
Line 339:
Line 340: @ValidateRunningAsRoot
Line 341: def test_ip_info(self):
Line 342: IP_ADDR = '192.0.2.2'
Line 343: IP_ADDR_SECOND = '192.0.2.3'
why do we have IP_ADDR_SECOND and then IP_ADDR2?
addresses are
considered secondary by the kernel if they are on the same interface in the same subnet.
IP_ADDR2 is another primary address.
Line 344: IPADDR_GW = '192.0.2.1'
Line 345: IP_ADDR2 = '198.51.100.9'
Line 346: IP_ADDR3 = '198.51.100.11'
Line 347: IP_ADDR2_GW = '198.51.100.1'
Line 340: @ValidateRunningAsRoot
Line 341: def test_ip_info(self):
Line 342: IP_ADDR = '192.0.2.2'
Line 343: IP_ADDR_SECOND = '192.0.2.3'
Line 344: IPADDR_GW = '192.0.2.1'
IP_ADDR_GW
Done
Line 345: IP_ADDR2 = '198.51.100.9'
Line 346: IP_ADDR3 = '198.51.100.11'
Line 347: IP_ADDR2_GW = '198.51.100.1'
Line 348: IPV6_ADDR = '2607:f0d0:1002:51::4'
--
To view, visit
https://gerrit.ovirt.org/33375
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8666cfef5bd8ea63edf8979e501d4785db5f4893
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <toni+ovirt(a)midokura.com>
Gerrit-Reviewer: Antoni Segura Puimedon <toni+ovirt(a)midokura.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes