Change in vdsm[master]: net: create bond properly during start_devices

phoracek at redhat.com phoracek at redhat.com
Mon Aug 10 13:11:53 UTC 2015


Petr Horáček has posted comments on this change.

Change subject: net: create bond properly during start_devices
......................................................................


Patch Set 1: Code-Review-1

(4 comments)

https://gerrit.ovirt.org/#/c/44587/1//COMMIT_MSG
Commit Message:

Line 5: CommitDate: 2015-08-09 11:39:43 +0300
Line 6: 
Line 7: net: create bond properly during start_devices
Line 8: 
Line 9: This methof, that is used during networks rollback, calls ifup on
method
Line 10: all ifcfg files it knows of however, to ifup a bond, one needs to
Line 11: manually create it first, by writing '+bondingName' into
Line 12: /sys/class/net/bonding_masters . Ifcfg configurators already does
Line 13: so when creating bonds. Skipping this step causes ifup to fail and


Line 6: 
Line 7: net: create bond properly during start_devices
Line 8: 
Line 9: This methof, that is used during networks rollback, calls ifup on
Line 10: all ifcfg files it knows of however, to ifup a bond, one needs to
knows of. However, (?)
Line 11: manually create it first, by writing '+bondingName' into
Line 12: /sys/class/net/bonding_masters . Ifcfg configurators already does
Line 13: so when creating bonds. Skipping this step causes ifup to fail and
Line 14: complain: 'Device bond11 does not seem to be present, delaying


https://gerrit.ovirt.org/#/c/44587/1/vdsm/network/configurators/ifcfg.py
File vdsm/network/configurators/ifcfg.py:

Line 704: def start_devices(device_ifcfgs):
Line 705:     for dev in _sort_device_ifcfgs(device_ifcfgs):
Line 706:         try:
Line 707:             if _ifcfg_defines_bonding(dev, device_ifcfgs):
Line 708:                 with open(netinfo.BONDING_MASTERS, 'w') as bondingMasters:
why camel case?
Line 709:                     bondingMasters.write('+%s\n' % dev)
Line 710:             _exec_ifup(dev)
Line 711:         except ConfigNetworkError:
Line 712:             logging.error('Failed to ifup device %s during rollback.', dev,


Line 723:             except IOError as e:
Line 724:                 if e.errno == os.errno.ENOENT:
Line 725:                     continue
Line 726:                 else:
Line 727:                     raise
Is not it better to return False here? So the function will always return True or False, not None.
Line 728: 
Line 729: 
Line 730: def _sort_device_ifcfgs(device_ifcfgs):
Line 731:     devices = {'Bridge': [],


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic48f3e8b51e4e7e8668902a785c7c271ada03df6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Petr Horacek <phoracek at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list