Moti Asayag has posted comments on this change.

Change subject: engine: Refactor CommonNetworkValidation
......................................................................


Patch Set 1: (1 inline comment)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/dc/NetworkCommon.java
Line 103:         return (vlanId >= 0 && vlanId <= 4095);
Line 104:     }
Line 105: 
Line 106:     protected boolean networkNotAttachedToCluster(final Network 
network) {
Line 107:         if (network.getstorage_pool_id() != null) {
I know that this code was there before, but how come that storage_pool_id is 
null for a network ? 

I think we should add to the Network validation not-null for the 
storage_pool_id field or make sure there is a validation for storage-pool where 
it is required or check for existence of the network prior to calling this 
method.

In addition the logic of this method can be replaced by a single call to 
NetworkClusterDao.getAllForNetwork - if it returns an empty list, it means the 
network isn't attached to any cluster.
Line 108:             List<VDSGroup> clusters = 
getVdsGroupDAO().getAllForStoragePool(
Line 109:                     network.getstorage_pool_id().getValue());
Line 110:             for (VDSGroup cluster : clusters) {
Line 111:                 Network attachedNetwork = 
getNetworkDAO().getByNameAndCluster(network.getName(), cluster.getId());


--
To view, visit http://gerrit.ovirt.org/10462
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie55a702efbeaaa852de93411fc5eaebc68ceefff
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Livnat Peer <[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

Reply via email to