Alona Kaplan has uploaded a new change for review. Change subject: webadmin: Labeled Networks with vlan shown outside the label group ......................................................................
webadmin: Labeled Networks with vlan shown outside the label group Due to a bug (the claculation of the nic labels was done for all the nics and not just the physical nic), in setup networks dialog labeled networks with vlan were attached to the correct nic but were outside the label group. Change-Id: Iefbe55854ac5b4cad6c8ab79b93edf5500fb0a81 Bug-Url: https://bugzilla.redhat.com/1067928 Signed-off-by: Alona Kaplan <alkap...@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java 1 file changed, 34 insertions(+), 32 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/77/25477/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java index 67c32dd..e5302d6 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java @@ -712,37 +712,6 @@ netToBeforeSyncParams.put(networkName, new NetworkParameters(nic)); } } - - // does this nic have any labels? - Set<String> labels = nic.getLabels(); - if (labels != null) { - for (String label : labels) { - labelToIface.put(label, ifName); - NetworkLabelModel labelModel = networkLabelMap.get(label); - if (labelModel != null) { - // attach label networks to nic - for (Iterator<LogicalNetworkModel> iter = labelModel.getNetworks().iterator(); iter.hasNext();) { - LogicalNetworkModel networkModel = iter.next(); - - if (nicToNetwork.get(ifName).contains(networkModel)) { - networkModel.attachViaLabel(); - } else { - // The network has the same label as the nic but not attached to the nic. - iter.remove(); - errorLabelNetworks.add(networkModel); - } - } - - // attach label itself to nic - List<NetworkLabelModel> nicLabels = nicToLabels.get(ifName); - if (nicLabels == null) { - nicLabels = new ArrayList<NetworkLabelModel>(); - nicToLabels.put(ifName, nicLabels); - } - nicLabels.add(labelModel); - } - } - } } // calculate the next available bond name @@ -764,10 +733,43 @@ if (nic.getBondName() != null) { continue; } - Collection<LogicalNetworkModel> nicNetworks = nicToNetwork.get(nicName); + List<NetworkLabelModel> nicLabels = nicToLabels.get(nicName); + + // does this nic have any labels? + Set<String> labels = nic.getLabels(); + if (labels != null) { + for (String label : labels) { + labelToIface.put(label, nicName); + NetworkLabelModel labelModel = networkLabelMap.get(label); + if (labelModel != null) { + // attach label networks to nic + for (Iterator<LogicalNetworkModel> iter = labelModel.getNetworks().iterator(); iter.hasNext();) { + LogicalNetworkModel networkModel = iter.next(); + + if (nicToNetwork.get(nicName).contains(networkModel)) { + networkModel.attachViaLabel(); + } else { + // The network has the same label as the nic but not attached to the nic. + iter.remove(); + errorLabelNetworks.add(networkModel); + } + } + + // attach label itself to nic + if (nicLabels == null) { + nicLabels = new ArrayList<NetworkLabelModel>(); + nicToLabels.put(nicName, nicLabels); + } + nicLabels.add(labelModel); + } + } + } + + Collection<LogicalNetworkModel> nicNetworks = nicToNetwork.get(nicName); List<VdsNetworkInterface> bondedNics = bondToNic.get(nicName); NetworkInterfaceModel nicModel; + if (bondedNics != null) { List<NetworkInterfaceModel> bondedModels = new ArrayList<NetworkInterfaceModel>(); for (VdsNetworkInterface bonded : bondedNics) { -- To view, visit http://gerrit.ovirt.org/25477 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iefbe55854ac5b4cad6c8ab79b93edf5500fb0a81 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alona Kaplan <alkap...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches