Ido Barkan has posted comments on this change. Change subject: net: create bond properly during start_devices ......................................................................
Patch Set 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 Done 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, (?) Done 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? Done 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 T the raise statement indicates that there is an unexpected error. but in the end of the for loop it is a good idea to raise one since this function expects to find an ifcfg for the given device_name 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 <[email protected]> Gerrit-Reviewer: Ido Barkan <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondřej Svoboda <[email protected]> Gerrit-Reviewer: Petr Horacek <[email protected]> Gerrit-Reviewer: Petr Horáček <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
