Alona Kaplan has uploaded a new change for review. Change subject: webadmin: [SetupNetwork] networks detached when adding nic to a bond ......................................................................
webadmin: [SetupNetwork] networks detached when adding nic to a bond When adding nic to a bond the networks on the nic should be attached to the bond. The bug is that the order was- 1. Detach the networks from the nic. 2. Determine the nic's networks. 3. Attach the nic's networks to the bond. Step 1 and 2 should be switched. Because after detaching there is no networks on the nic. Change-Id: I5c2941106968dc08d8251d033a6274c9a272ade0 Signed-off-by: Alona Kaplan <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkOperation.java 1 file changed, 7 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/32/10432/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkOperation.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkOperation.java index 96d5990..b39d8aa 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkOperation.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkOperation.java @@ -177,14 +177,16 @@ NetworkInterfaceModel nic = (NetworkInterfaceModel) op1; BondNetworkInterfaceModel bond = (BondNetworkInterfaceModel) op2; - assert nic.getItems().size() == 0 || bond.getItems().size() == 0; + // Save the networks on the nic before they are detached + List<LogicalNetworkModel> networksToReatach = + nic.getItems() != null ? new ArrayList<LogicalNetworkModel>(nic.getItems()) + : new ArrayList<LogicalNetworkModel>(); - // detach possible networks from the nic + // Detach possible networks from the nic clearNetworks(nic, allNics); - // Attach previous networks to bond - List<LogicalNetworkModel> networks = new ArrayList<LogicalNetworkModel>(nic.getItems()); - attachNetworks(bond, networks, allNics); + // Attach previous nic networks to bond + attachNetworks(bond, networksToReatach, allNics); nic.getEntity().setBondName(bond.getEntity().getName()); } -- To view, visit http://gerrit.ovirt.org/10432 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c2941106968dc08d8251d033a6274c9a272ade0 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alona Kaplan <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
