Change in vdsm[master]: Advertise aggregator ID in bonding interfaces

sshnaidm at redhat.com sshnaidm at redhat.com
Wed Feb 10 01:44:40 UTC 2016


Sagi Shnaidman has posted comments on this change.

Change subject: Advertise aggregator ID in bonding interfaces
......................................................................


Patch Set 5:

(5 comments)

https://gerrit.ovirt.org/#/c/53100/5/lib/vdsm/netinfo/bonding.py
File lib/vdsm/netinfo/bonding.py:

Line 68: def info(link):
Line 69:     return {'hwaddr': link.address, 'slaves': slaves(link.name),
Line 70:             'active_slave': _active_slave(link.name),
Line 71:             'opts': _getBondingOptions(link.name),
Line 72:             'aggregator_id': nics._get_aggregator_id(link.name) or ''}
> does this work for the bonding device itself? is it listed under bonding_sl
Fixed
Line 73: 
Line 74: 
Line 75: def _active_slave(bond_name):
Line 76:     """


https://gerrit.ovirt.org/#/c/53100/5/lib/vdsm/netinfo/nics.py
File lib/vdsm/netinfo/nics.py:

Line 18: # Refer to the README and COPYING files for full details of the license
Line 19: from __future__ import absolute_import
Line 20: import errno
Line 21: import io
Line 22: import os
> put in alphabet order, please
actually it was :) fixed a little.
Line 23: from functools import partial
Line 24: import logging
Line 25: 
Line 26: from ..ipwrapper import drv_name


Line 74:         return 0
Line 75: 
Line 76: 
Line 77: def _get_aggregator_id(nic_name):
Line 78:     agg_id_path = '/sys/class/net/{nic}/bonding_slave/ad_aggregator_id'.format(
> this string begs to sit with the other BONDING_ constants in bonding.pu (ma
I thought about this, but nic.py is already imported in bonding.py, so can't import it here.
I'd leave it here, because it's real NIC attribute.
Line 79:         nic=nic_name)
Line 80:     if os.path.exists(agg_id_path):
Line 81:         try:
Line 82:             with open(agg_id_path, "r") as f:


Line 84: except IOError
> when can this happen? it is unacceptable to trash the log with exceptions e
This could happen only when file exists and not readable, quite rare situation, removed this.

I don't think it will print this message too much, although


Line 93: aggregator_id
> naming: i'd keep the ad_ prefeix from kernel
Done


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I85267967c9cb1b0a626d91cb1953361ed4de727a
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Sagi Shnaidman <sshnaidm 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: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: Sagi Shnaidman <sshnaidm at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list