Dan Kenigsberg has posted comments on this change.

Change subject: report mtus as string as long as engine needs it
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.ovirt.org/#/c/51164/1/lib/vdsm/netinfo/__init__.py
File lib/vdsm/netinfo/__init__.py:

Line 101: def stringify_mtus(networking):
Line 102:     # REQUIRED_FOR engine < 3.7
Line 103:     for devtype in ('bondings', 'bridges', 'networks', 'nics', 
'vlans'):
Line 104:         for dev in networking[devtype]:
Line 105:             dev['mtu'] = str(dev['mtu'])
> I think it needs to be immutable and return a copy, it may avoid future mis
My patch modifies the original. I'd hate to deep-copy this big structure just 
for replacing the type of few elements. But I surely need to add a test making 
sure that the MTU is indeed is a string.
Line 106:     return networking
Line 107: 
Line 108: 
Line 109: def libvirtNets2vdsm(nets, running_config=None, routes=None, 
ipAddrs=None,


https://gerrit.ovirt.org/#/c/51164/1/vdsm/caps.py
File vdsm/caps.py:

Line 632: stringify_mtus(netinfo.get())
> What about calling it something like: netinfo.get(normalize_for_compatibili
The only down side I see is that I'd like this backward-compatibility code to 
be easily removed when we can stop supporting older Engines.

Please note that we should have a very specific name such as string_mtus=True.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I719ed889bfae763ce7cbed4f2aab3f6134ba2865
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Edward Haas <edwa...@redhat.com>
Gerrit-Reviewer: Ido Barkan <ibar...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzasp...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to