Ondřej Svoboda has uploaded a new change for review.

Change subject: netinfo: It is sufficient to infer 'dhcpv4' from the existence 
of a DHCP lease
......................................................................

netinfo: It is sufficient to infer 'dhcpv4' from the existence of a DHCP lease

If we found an active (not outdated) DHCPv4 lease for an interface we don't
have to check if we have an address. Most probably it will be there.
If it weren't we would not be concerned about 'dhcpv4' attribute anyway.

Change-Id: Ie635f332958e717a561227a276333afe72cdbae0
Signed-off-by: Ondřej Svoboda <[email protected]>
---
M lib/vdsm/netinfo.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/36182/1

diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index 06aacdd..c8ad3a0 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -437,7 +437,7 @@
         ipv4addr, ipv4netmask, ipv4addrs, ipv6addrs = getIpInfo(iface, ipaddrs)
         data.update({'iface': iface, 'bridged': bridged,
                      'addr': ipv4addr, 'netmask': ipv4netmask,
-                     'dhcpv4': bool(ipv4addr) and iface in dhcpv4,
+                     'dhcpv4': iface in dhcpv4,
                      'ipv4addrs': ipv4addrs,
                      'ipv6addrs': ipv6addrs,
                      'gateway': _get_gateway(routes, iface),
@@ -489,7 +489,7 @@
             'ipv6addrs': ipv6addrs,
             'gateway': _get_gateway(routes, link.name),
             'ipv6gateway': _get_gateway(routes, link.name, family=6),
-            'dhcpv4': bool(ipv4addr) and link.name in dhcpv4,
+            'dhcpv4': link.name in dhcpv4,
             'mtu': str(link.mtu),
             'netmask': ipv4netmask}
     if 'BOOTPROTO' not in info['cfg']:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie635f332958e717a561227a276333afe72cdbae0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to