Lior Vernia has posted comments on this change.

Change subject: webadmin: Update HostSetupNetworks flow to use isManagement
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.ovirt.org/#/c/37028/3/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/LogicalNetworkModel.java
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/LogicalNetworkModel.java:

Line 29: 
Line 30:     public LogicalNetworkModel(Network network, HostSetupNetworksModel 
setupModel) {
Line 31:         this(setupModel);
Line 32:         setEntity(network);
Line 33:         if (network.getCluster() != null && 
network.getCluster().isManagement()) {
> Better safe than sorry
That is not a good answer. What you should have told me, is that this model 
could represent an unmanaged network, whose cluster won't be set.
Line 34:             setManagement(true);
Line 35:         }
Line 36:     }
Line 37: 


Line 30:     public LogicalNetworkModel(Network network, HostSetupNetworksModel 
setupModel) {
Line 31:         this(setupModel);
Line 32:         setEntity(network);
Line 33:         if (network.getCluster() != null && 
network.getCluster().isManagement()) {
Line 34:             setManagement(true);
> the member is used not only for caching. setManagement method is used from 
This is weird. One of these calls has to be redundant (otherwise you could have 
two different networks marked as management).

Is the backend data consistent? I.e. network.getCluster().isManagement() iff 
nic.getIsManagement()? If it is...

Then in the current state of things, I think it's better to remove the other 
call to setManagement(), because the check you added in 
HostSetupNetworksModel.initNetworkModels() already depends on this field before 
setManagement() is called from HostSetupNetworksModel.initNicModels().

And then the member will be redundant.
Line 35:         }
Line 36:     }
Line 37: 
Line 38:     /**


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3bb6d8149d895a5834c5fb59e357a9acab7cb00d
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yevgeny Zaspitsky <yzasp...@redhat.com>
Gerrit-Reviewer: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzasp...@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

Reply via email to