Lior Vernia has posted comments on this change.

Change subject: webadmin: [Labels] SetupNetwork emphasize unconfigured interface
......................................................................


Patch Set 6:

(3 comments)

http://gerrit.ovirt.org/#/c/24975/6/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java:

Line 781:             }
Line 782: 
Line 783:             nicModels.put(nicName, nicModel);
Line 784:         }
Line 785:         initLabeledNetworksErrorMessages(errorLabelNetworks, 
nicModels);
Nice solution, I liked it. I'm worried that this code is getting complicated :)
Line 786:         setNics(nicModels);
Line 787:     }
Line 788: 
Line 789:     private void 
initLabeledNetworksErrorMessages(List<LogicalNetworkModel> errorLabelNetworks, 
Map<String, NetworkInterfaceModel> nicModels){


Line 791:             NetworkInterfaceModel desiredNic = 
nicModels.get(labelToIface.get(networkModel.getEntity().getLabel()));
Line 792:             NetworkOperation operation = 
NetworkOperationFactory.operationFor(networkModel, desiredNic);
Line 793:             UIMessages messages = 
ConstantsManager.getInstance().getMessages();
Line 794:             String errorMessagePrefix;
Line 795:             String errorMessageSuffix = ""; //$NON-NLS-1$
I don't see the advantage of using two String variables rather than setting the 
message to one thing if the operation is null string (where "one thing" would 
be the concatenation of the two messages), else to another.
Line 796:             // Should be attached but can't due to conflict
Line 797:             if (operation.isNullOperation()){
Line 798:                 errorMessagePrefix = 
messages.networkLabelConflict(desiredNic.getName(), 
networkModel.getEntity().getLabel()) + " "; //$NON-NLS-1$
Line 799:                 errorMessageSuffix = 
operation.getMessage(networkModel, desiredNic);


Line 796:             // Should be attached but can't due to conflict
Line 797:             if (operation.isNullOperation()){
Line 798:                 errorMessagePrefix = 
messages.networkLabelConflict(desiredNic.getName(), 
networkModel.getEntity().getLabel()) + " "; //$NON-NLS-1$
Line 799:                 errorMessageSuffix = 
operation.getMessage(networkModel, desiredNic);
Line 800:             }else {
Spacing here.
Line 801:                 errorMessagePrefix = 
messages.labledNetworkNotAttached(desiredNic.getName(), 
networkModel.getEntity().getLabel());
Line 802:             }
Line 803:             networkModel.setErrorMessage(errorMessagePrefix + 
errorMessageSuffix);
Line 804:         }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifa83ddfd2ceddc8f2227dcc8cc36c721baf8c7bc
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Lior Vernia <lver...@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