Hello Petr Horáček, Dan Kenigsberg, Edward Haas,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/65303
to review the following change.
Change subject: net ifcfg: fix bond rollback ......................................................................
net ifcfg: fix bond rollback
When setupNetworks(NET, BOND) fails on NET configuration, BOND ifcfg file is removed, but it still exists in the system. We have to remove it manually like we do in removeBonding().
This must be backported to fix new functional tests on 4.0.
Change-Id: I5cea6ec71c913d74d95317ff7318259d64b40969 Signed-off-by: Petr Horáček phoracek@redhat.com Reviewed-on: https://gerrit.ovirt.org/59940 Reviewed-by: Edward Haas edwardh@redhat.com Continuous-Integration: Jenkins CI Reviewed-by: Dan Kenigsberg danken@redhat.com Bug-Url: https://bugzilla.redhat.com/1374194 Reviewed-on: https://gerrit.ovirt.org/64509 --- M lib/vdsm/network/configurators/ifcfg.py 1 file changed, 16 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/03/65303/1
diff --git a/lib/vdsm/network/configurators/ifcfg.py b/lib/vdsm/network/configurators/ifcfg.py index 710dec1..bd3eec1 100644 --- a/lib/vdsm/network/configurators/ifcfg.py +++ b/lib/vdsm/network/configurators/ifcfg.py @@ -754,6 +754,10 @@ if os.path.exists('/sys/class/net/%s/bridge' % dev): # ifdown is not enough to remove nicless bridges commands.execCmd([constants.EXT_BRCTL, 'delbr', dev]) + if _is_bond_name(dev): + if _is_running_bond(dev): + with open(netinfo_bonding.BONDING_MASTERS, 'w') as f: + f.write("-%s\n" % dev)
def start_devices(device_ifcfgs): @@ -761,10 +765,8 @@ try: # this is an ugly way to check if this is a bond but picking into # the ifcfg files is even worse. - if dev.startswith('bond') and '.' not in dev: - with open(netinfo_bonding.BONDING_MASTERS) as info: - names = info.read().split() - if dev not in names: + if _is_bond_name(dev): + if not _is_running_bond(dev): with open(netinfo_bonding.BONDING_MASTERS, 'w') as masters: masters.write('+%s\n' % dev) _exec_ifup_by_name(dev) @@ -773,6 +775,16 @@ exc_info=True)
+def _is_bond_name(dev): + return dev.startswith('bond') and '.' not in dev + + +def _is_running_bond(bond): + with open(netinfo_bonding.BONDING_MASTERS) as info: + names = info.read().split() + return bond in names + + def _sort_device_ifcfgs(device_ifcfgs): devices = {'Bridge': [], 'Vlan': [],
gerrit-hooks has posted comments on this change.
Change subject: net ifcfg: fix bond rollback ......................................................................
Patch Set 1:
* #59940::Update tracker: OK * #64509::Update tracker: OK * #1374194::Update tracker: OK * Check Bug-Url::OK * Check Public Bug::#1374194::OK, public bug * Check Product::#59940::IGNORE, not relevant for classification: Retired * Check Product::#64509::IGNORE, not relevant for classification: Retired * Check Product::#1374194::WARN, wrong product: ovirt-engine * Check TM::SKIP, not in a monitored branch (ovirt-3.6 ovirt-4.0) * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Francesco Romani has posted comments on this change.
Change subject: net ifcfg: fix bond rollback ......................................................................
Patch Set 1: Code-Review+2 Verified+1
same code as ovirt-4.0, patch applied in the same order ovirt-4.0.5 branched too early
Francesco Romani has posted comments on this change.
Change subject: net ifcfg: fix bond rollback ......................................................................
Patch Set 1: Continuous-Integration+1
run 'make check' manually and succesfully.
Francesco Romani has submitted this change and it was merged.
Change subject: net ifcfg: fix bond rollback ......................................................................
net ifcfg: fix bond rollback
When setupNetworks(NET, BOND) fails on NET configuration, BOND ifcfg file is removed, but it still exists in the system. We have to remove it manually like we do in removeBonding().
This must be backported to fix new functional tests on 4.0.
Change-Id: I5cea6ec71c913d74d95317ff7318259d64b40969 Signed-off-by: Petr Horáček phoracek@redhat.com Reviewed-on: https://gerrit.ovirt.org/59940 Reviewed-by: Edward Haas edwardh@redhat.com Continuous-Integration: Jenkins CI Reviewed-by: Dan Kenigsberg danken@redhat.com Bug-Url: https://bugzilla.redhat.com/1374194 Reviewed-on: https://gerrit.ovirt.org/64509 Reviewed-on: https://gerrit.ovirt.org/65303 Reviewed-by: Francesco Romani fromani@redhat.com Tested-by: Francesco Romani fromani@redhat.com Continuous-Integration: Francesco Romani fromani@redhat.com --- M lib/vdsm/network/configurators/ifcfg.py 1 file changed, 16 insertions(+), 4 deletions(-)
Approvals: Francesco Romani: Verified; Looks good to me, approved; Passed CI tests
gerrit-hooks has posted comments on this change.
Change subject: net ifcfg: fix bond rollback ......................................................................
Patch Set 2:
* #1374194::Update tracker: OK * Set MODIFIED::bug 1374194::::#1374194::::IGNORE, not all related patches are closed, check 64507
vdsm-patches@lists.fedorahosted.org