Ondřej Svoboda has posted comments on this change.

Change subject: netinfo: rework reporting of DHCPv4/6 on network devices
......................................................................


Patch Set 4:

(2 comments)

https://gerrit.ovirt.org/#/c/46430/4/lib/vdsm/netinfo.py
File lib/vdsm/netinfo.py:

Line 606:                     'dhcpv6': net_attrs['dhcpv6'],
Line 607:                     'cfg': cfg,
Line 608:                 }
Line 609:             }
Line 610:             # Don't overwrite BOOTPROTO field fetched from a real 
ifcfg file.
> I didn't quite get this. can you explain?
For long we have wanted not to touch BOOTPROTO originally obtained from a given 
ifcfg file, we only added the field if it didn't exist.

Since BOOTPROTO is already written by _devinfo this is no longer easy to do: it 
used to done in one go.

Moreover, this heuristic is not perfect: ifcfg files may be populated with a 
few fields and have no BOOTPROTO at all. I suspect even ifcfg configurator does 
this because ipv4.bootproto may contain a None instead of "none" (see 
_objectivizeNetwork in network.api).
Line 611:             # If there was none, BOOTPROTO is probably the only field 
and it
Line 612:             # was created in _devinfo. Required by oVirt engines < 
3.6.
Line 613:             if len(devinfo['cfg']) == 1 or 'BOOTPROTO' not in 
devinfo['cfg']:
Line 614:                 cfg['BOOTPROTO'] = 'dhcp' if net_attrs['dhcpv4'] else 
'none'


Line 834: 
Line 835:     for net, attrs in d['networks'].iteritems():
Line 836:         if attrs['bridged']:
Line 837:             attrs['cfg'] = d['bridges'][net]['cfg']
Line 838:         updated_netinfo = _propose_updates_to_reported_dhcp(attrs, d)
> could you name the parameters during the call for _propose_updates_to_repor
Instead, I rename d and attrs in a patch I inserted before this one.
Line 839:         _update_nested_dict(d, updated_netinfo)
Line 840: 
Line 841:     return d
Line 842: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaffdc836f8f64ecdc0a7e37ef50c228032f99696
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <[email protected]>
Gerrit-Reviewer: Ido Barkan <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to