Change in vdsm[master]: netinfo: make getNicsVlanAndBondingForNetwork more readable, ...

osvoboda at redhat.com osvoboda at redhat.com
Wed Aug 19 19:39:30 UTC 2015


Ondřej Svoboda has posted comments on this change.

Change subject: netinfo: make getNicsVlanAndBondingForNetwork more readable, drop asserts
......................................................................


Patch Set 4:

(1 comment)

The checks are not necessary.

One more thing to note: if a network doesn't exist, getNicsVlanAndBondingForNetwork raises IndexError. One caller is prepared to catch it, I'll check others (they should not reach it but let's be sure).

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

Line 917
Line 918
Line 919
Line 920
Line 921
> Can you explain why this assert is not correct?
All asserts were correct under the assumption that I described in the new comment: that there is at most a single hierarchy of a bridge, a VLAN and a bond, all of which may be missing, on top of NIC(s); the other ports are TUN devices.

Since I am now pretty sure the assumption holds we don't need the asserts. To prove correctness of the function I wrote a (hopefully) comprehensive test, https://gerrit.ovirt.org/45112


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If8535dbd29314c97e4519b160a47c9ea6489b5a3
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list