Mike Kolesnik has posted comments on this change.
Change subject: engine: Refactoring in unassign network from cluster command
......................................................................
Patch Set 6: (2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/DetachNetworkToVdsGroupCommand.java
Line 84:
Line 85: public ValidationResult clusterNetworkNotUsedByTemplates() {
Line 86: List<VmTemplate> templatesUsingNetwork = new
ArrayList<VmTemplate>();
Line 87: for (VmTemplate template :
getVmTemplateDAO().getAllForVdsGroup(networkCluster.getClusterId())) {
Line 88: for (VmNetworkInterface nic :
getVmNetworkInterfaceDao().getAllForTemplate(networkCluster.getClusterId())) {
I think you meant:
getVmNetworkInterfaceDao().getAllForTemplate(*template.getId()*)
Line 89: if (nic.getNetworkName() == network.getName()) {
Line 90: templatesUsingNetwork.add(template);
Line 91: }
Line 92: }
Line 85: public ValidationResult clusterNetworkNotUsedByTemplates() {
Line 86: List<VmTemplate> templatesUsingNetwork = new
ArrayList<VmTemplate>();
Line 87: for (VmTemplate template :
getVmTemplateDAO().getAllForVdsGroup(networkCluster.getClusterId())) {
Line 88: for (VmNetworkInterface nic :
getVmNetworkInterfaceDao().getAllForTemplate(networkCluster.getClusterId())) {
Line 89: if (nic.getNetworkName() == network.getName()) {
This should be done using equals, otherwise you're comparing references not
values.
Line 90: templatesUsingNetwork.add(template);
Line 91: }
Line 92: }
Line 93: }
--
To view, visit http://gerrit.ovirt.org/10683
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I127615d9144084ad093ac1d20841979be8163a12
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Livnat Peer <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Muli Salem <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches