Lior Vernia has posted comments on this change. Change subject: webadmin: Gluster network role in UI ......................................................................
Patch Set 5: (4 comments) https://gerrit.ovirt.org/#/c/37476/5/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterNetworkManageModel.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterNetworkManageModel.java: Line 120: } Line 121: Line 122: private ClusterNetworkModel getGlusterNetwork() { Line 123: if (!isMultiCluster()) { Line 124: for (ClusterNetworkModel clusterNetworkManageModel : getItems()) { There's no reason to iterate over all the models each time - I'd iterate once when ClusterNetworkManageModel is populated, and then keep an up-to-date reference to the gluster network (as is done for the management network). If you change this, then there's also no reason to keep the !isMultiCluster() check - this would return null anyway in case this isMultiCluster() (not that an invocation makes sense in that case). Line 125: if (clusterNetworkManageModel.isGlusterNetwork()) { Line 126: return clusterNetworkManageModel; Line 127: } Line 128: } Line 130: return null; Line 131: } Line 132: Line 133: public void setGlusterNetwork(ClusterNetworkModel model, boolean value) { Line 134: if (!isMultiCluster()) { Here you would also update the pointer to the new gluster network... Line 135: if (value) { Line 136: // Reset the old gluster network Line 137: if (getGlusterNetwork() != null) { Line 138: getGlusterNetwork().setGlusterNetwork(false); https://gerrit.ovirt.org/#/c/37476/5/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterNetworkView.java File frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterNetworkView.java: Line 148: } Line 149: Line 150: if (network.getCluster().isGluster()) { Line 151: imagesToText.put(glusterNwImage, constants.glusterNwItemInfo()); Line 152: Redundant newline? Line 153: } Line 154: } Line 155: return NetworkRoleColumnHelper.getTooltip(imagesToText); Line 156: } https://gerrit.ovirt.org/#/c/37476/5/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/network/SubTabNetworkClusterView.java File frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/network/SubTabNetworkClusterView.java: Line 196: if (networkCluster.isManagement()) { Line 197: res += 10; Line 198: } Line 199: if (networkCluster.isDisplay()) { Line 200: res += 3; This isn't good enough, since a network that's migration + gluster can compete with display, thus returning an ill-defined result. 4 would do fine :) Line 201: } Line 202: if (networkCluster.isMigration()) { Line 203: res += 2; Line 204: } -- To view, visit https://gerrit.ovirt.org/37476 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09660b88ee48024f02eb915ce6c98c27a7064775 Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Sahina Bose <sab...@redhat.com> Gerrit-Reviewer: Lior Vernia <lver...@redhat.com> Gerrit-Reviewer: Ramesh N <rnach...@redhat.com> Gerrit-Reviewer: Sahina Bose <sab...@redhat.com> Gerrit-Reviewer: Yevgeny Zaspitsky <yzasp...@redhat.com> Gerrit-Reviewer: anmolbabu <anb...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches