Change in vdsm[master]: net: IP DHCP detection

danken at redhat.com danken at redhat.com
Fri Feb 5 12:38:17 UTC 2016


Dan Kenigsberg has posted comments on this change.

Change subject: net: IP DHCP detection
......................................................................


Patch Set 5: Code-Review-1

(2 comments)

https://gerrit.ovirt.org/#/c/53076/5/lib/vdsm/netinfo/dhcp.py
File lib/vdsm/netinfo/dhcp.py:

Line 73:     is_dhcpv4 = False
Line 74:     is_dhcpv6 = False
Line 75:     for ipaddr in ipaddrs[iface]:
Line 76:         if addresses.is_ipv4(ipaddr):
Line 77:             is_dhcpv4 |= addresses.is_permanent(ipaddr)
it's probably my fault (asking not to use "dynamic") but I think you lost a "not" here.

if you found a NON-permanent address, you should report dchcp=True.

That tests that let this error slip should be made more careful.
Line 78:         elif addresses.is_ipv6(ipaddr):
Line 79:             is_dhcpv6 |= addresses.is_permanent(ipaddr)
Line 80:     return is_dhcpv4, is_dhcpv6
Line 81: 


https://gerrit.ovirt.org/#/c/53076/5/lib/vdsm/netlink/addr.py
File lib/vdsm/netlink/addr.py:

Line 75: not in
ah, the "not" is here.

so the code is correct, but confusing.


-- 
To view, visit https://gerrit.ovirt.org/53076
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d0396610822e3a41d44f37346ee1aad71d569d1
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list